Exemplo n.º 1
0
  public ControlWindow(String title) {
    props = Property.getProps();

    locale = new Locale(props.getProperty("resourcebundle"));
    rb = ResourceBundle.getBundle("language", locale);

    this.setBackground(new Color(1, 1, 1));
    container = this.getContentPane();
    container.setLayout(new FlowLayout());
    container.setSize(500, 300);

    // build the window frame
    createComponents();

    this.setSize(600, 400);
    this.setLocation(300, 200);

    // Now this will set the LAF(Look & Feel)
    setLookAndFeel();
    SwingUtilities.updateComponentTreeUI(this);
    this.pack();

    this.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            if (monitor != null) {
              monitor.interrupt();
            }
            System.exit(0);
          }
        });

    this.setVisible(true);
  }