Package javax.swing

Examples of javax.swing.JFrame.addWindowListener()


    }

    public static void main(String[] args) {

        JFrame frame = new JFrame("Property Editor Test bed");
        frame.addWindowListener(new WindowAdapter() {
                public void windowClosed(WindowEvent e) {
                    System.exit(1);
                }
            });
View Full Code Here


    properties.setProperty("context.path", "rcpstrutsdemo");
    Client.init(properties);
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(800, 600);
    frame.addWindowListener(new WindowAdapter() {
      @Override
      public void windowClosing(WindowEvent e) {
        Client.destroy();
      }
    });
View Full Code Here

        // show Frame
        frame.setSize(800, 600);
        frame.pack();
        frame.show();
        frame.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
          }
        });
      }
View Full Code Here

        oldValueCache.put(mappedProperty, mappedProperty.toString());
         
        mappedProperty.addPropertyChangeListener("value", oldValueChangeListener);
        // TF:01/03/2010:Ensure we're only in the cache once, even if the status text field is changed
        topLevelAncestor.removeWindowListener(windowClosingListener);
        topLevelAncestor.addWindowListener(windowClosingListener);
      }
      // TF:01/03/2010:Always update the old value in the cache, as the mouse exit handler will expect a valid value
      oldValueCache.put(mappedProperty, mappedProperty.toString());
      if (statusTextValue != null) {
        setStatusText(mappedProperty, statusTextValue.toString());
View Full Code Here

        oldValueCache.put(mappedProperty, mappedProperty.toString());
         
        mappedProperty.addPropertyChangeListener("value", oldValueChangeListener);
        // TF:01/03/2010:Ensure we're only in the cache once, even if the status text field is changed
        topLevelAncestor.removeWindowListener(windowClosingListener);
        topLevelAncestor.addWindowListener(windowClosingListener);
      }
      // TF:01/03/2010:Always update the old value in the cache, as the mouse exit handler will expect a valid value
      oldValueCache.put(mappedProperty, mappedProperty.toString());
      if (statusTextValue != null) {
        setStatusText(mappedProperty, statusTextValue.toString());
View Full Code Here

        oldValueCache.put(mappedProperty, mappedProperty.toString());
         
        mappedProperty.addPropertyChangeListener("value", oldValueChangeListener);
        // TF:01/03/2010:Ensure we're only in the cache once, even if the status text field is changed
        topLevelAncestor.removeWindowListener(windowClosingListener);
        topLevelAncestor.addWindowListener(windowClosingListener);
      }
      // TF:01/03/2010:Always update the old value in the cache, as the mouse exit handler will expect a valid value
      oldValueCache.put(mappedProperty, mappedProperty.toString());
      if (statusTextValue != null) {
        setStatusText(mappedProperty, statusTextValue.toString());
View Full Code Here

            window.add(jp);

            window.setLocation(0, 0);
            window.setSize(600, 600);

            window.addWindowListener(new WindowAdapter() {
                public void windowClosed(WindowEvent e) {
                    receiver.stop();
                }
            });
View Full Code Here

                            public void windowClosing(WindowEvent e) {
                                System.exit(0);
                            }
                        };

                        jFrame.addWindowListener(windowListener);

                        List execCommands = new LinkedList();
                        execCommands.add("date");
                        execCommands.add("sleep 5");
                        execCommands.add("date");
View Full Code Here

                            public void windowClosing(WindowEvent e) {
                                System.exit(0);
                            }
                        };

                        jFrame.addWindowListener(windowListener);

                        final ShellTextArea exec = new ShellTextArea();
                        jFrame.getContentPane().add(exec);
                        jFrame.pack();
                        jFrame.setVisible(true);
View Full Code Here

            Runnable doActions = new Runnable() {
                public void run() {
                    try {
                        JFrame frame = new FileChooserQuery();

                        frame.addWindowListener(new WindowAdapter() {
                            public void windowClosing(WindowEvent e) {
                                System.exit(0);
                            }
                        });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.