Package java.awt.event

Examples of java.awt.event.WindowAdapter


      }

      for (Iterator i = closeListeners.keySet().iterator(); i.hasNext();) {
        final String name = (String) i.next();
        final GUIEventListener listener = (GUIEventListener) closeListeners.get(name);
        dialog.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            listener.eventOccured(new GUIEvent(Dialog.this, name, e));
          }
        });
      }
View Full Code Here


   * Set the initial focus of the dialog
   */
  public void setInitialFocus(final Widget widget) throws GUIException {
    if (dialog == null)
      throw new GUIException("The dialog has not yet been created. Call setInitialFocus() after initDialog()");
    dialog.addWindowListener(new WindowAdapter() {
      public void windowOpened(WindowEvent e) {
        widget.requestFocus();
        e.getWindow().removeWindowListener(this);
      }
    });
View Full Code Here

    GUIUtils.unregister(this);
  }

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("close".equals(event)) {
      frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          listener.eventOccured(new GUIEvent(Frame.this, name, e));
        }
      });
    } else {
View Full Code Here

  /**
   * Set the initial focus of the frame
   */
  public void setInitialFocus(final Widget widget) {
    frame.addWindowListener(new WindowAdapter() {
      public void windowOpened(WindowEvent e) {
        widget.requestFocus();
        e.getWindow().removeWindowListener(this);
      }
    });
View Full Code Here

    total++;

    setPreferredSize(new Dimension(200,30*itemCount));
    JFrame frame = new JFrame(controller.getName());
    frame.setContentPane(new JScrollPane(this));
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        total--;
        if (total == 0) {
          System.exit(0);
        }
View Full Code Here

    mainPanel.add(lowerPanel, constraints.rcwh(6,1,3,1));
    getContentPane().add(mainPanel, BorderLayout.CENTER);
    getRootPane().setDefaultButton(nextButton);
    setDefaultCloseOperation(JInternalFrame.DO_NOTHING_ON_CLOSE);

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          fireCancel();
        }
    });
View Full Code Here

    setTitle("Gears");
    setBackground(Color.BLACK);
    AWTGearsCanvas canvas = new AWTGearsCanvas();
    canvas.setSize(300, 300);
    add(canvas);
    addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        dispose();
        System.exit(0);
      }
    });
View Full Code Here

      le.printStackTrace();
      return false;
    }
    // ---------------------------------

    addWindowListener(new WindowAdapter() {

      public void windowClosing(WindowEvent e) {
        demoCanvas.destroyCanvas();
        dispose();
        System.exit(0);
View Full Code Here

    setLayout(new GridLayout(1, 2));
    final Canvas display_parent = new Canvas();
    display_parent.setFocusable(true);
    display_parent.setIgnoreRepaint(true);
    add(display_parent);
    addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        killswitch = true;
      }
    });
    setResizable(true);
View Full Code Here

        } catch (LWJGLException e) {
          throw new RuntimeException(e);
        }
      }
    });
    addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        dispose();
        System.exit(0);
      }
    });
View Full Code Here

TOP

Related Classes of java.awt.event.WindowAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.