Example usage for java.awt.event WindowAdapter WindowAdapter

List of usage examples for java.awt.event WindowAdapter WindowAdapter

Introduction

In this page you can find the example usage for java.awt.event WindowAdapter WindowAdapter.

Prototype

WindowAdapter

Source Link

Usage

From source file:EditorPaneExample6.java

public static void main(String[] args) {
    try {/*from www  .j  a  v a  2  s. c o m*/
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception evt) {
    }

    JFrame f = new EditorPaneExample6();

    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent evt) {
            System.exit(0);
        }
    });
    f.setSize(500, 400);
    f.setVisible(true);
}

From source file:BorderDemo.java

public static void main(String[] args) {
    JFrame frame = new BorderDemo();
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);/* w  ww  .j a  v  a2  s. c  om*/
        }
    });

    frame.pack();
    frame.setVisible(true);
}

From source file:ClipImage.java

public static void main(String s[]) {
    final ClipImage demo = new ClipImage();
    WindowListener l = new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);//ww w  .j  a v a2s  .  c om
        }

        public void windowDeiconified(WindowEvent e) {
            demo.start();
        }

        public void windowIconified(WindowEvent e) {
            demo.stop();
        }
    };
    JFrame f = new JFrame("Java 2D Demo - ClipImage");
    f.addWindowListener(l);
    f.getContentPane().add("Center", demo);
    f.setSize(new Dimension(400, 300));
    f.show();
    demo.start();
}

From source file:ClipImage.java

public static void main(String s[]) {
    final ClipImage demo = new ClipImage();
    WindowListener l = new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);/*from  w  w w .jav a2s .  c o  m*/
        }

        public void windowDeiconified(WindowEvent e) {
            demo.start();
        }

        public void windowIconified(WindowEvent e) {
            demo.stop();
        }
    };
    JFrame f = new JFrame("Java 2D Demo - ClipImage");
    f.addWindowListener(l);
    f.getContentPane().add("Center", demo);
    f.setSize(new Dimension(400, 300));
    f.setVisible(true);
    demo.start();
}

From source file:com.joey.software.memoryToolkit.MemoryUsagePanel.java

/**
 * Entry point for the sample application.
 * /* w  w w . ja  v  a2  s . c om*/
 * @param args
 *            ignored.
 */
public static void main(String[] args) {
    JFrame frame = new JFrame("Memory Usage Demo");
    MemoryUsagePanel panel = new MemoryUsagePanel(500, 20);
    frame.getContentPane().add(panel, BorderLayout.CENTER);
    frame.setBounds(200, 120, 600, 280);
    frame.setVisible(true);
    frame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    });

    panel.startUpdating();

    byte[][][] data = new byte[1024][1024][10];
}

From source file:EditorPaneExample10A.java

public static void main(String[] args) {
    try {//from  w  ww. jav  a2 s  .  c om
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception evt) {
    }

    JFrame f = new EditorPaneExample10A();

    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent evt) {
            System.exit(0);
        }
    });
    f.setSize(500, 400);
    f.setVisible(true);
}

From source file:IDlook.java

public static void main(String[] args) {
    IDlook id = new IDlook();

    id.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);/*from  w w w . j  a  v a2 s . co  m*/
        }
    });

    id.init();
    id.buildGUI();
}

From source file:DecimalFormatDemo.java

public static void main(String s[]) {
    WindowListener l = new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);//from   w w  w  .j a  v a  2 s.com
        }
    };

    frame = new JFrame("DecimalFormat Demo");
    frame.addWindowListener(l);
    frame.getContentPane().add("Center", new DecimalFormatDemo());
    frame.pack();
    frame.setVisible(true);
}

From source file:IDlookBlob.java

public static void main(String[] args) {
    IDlookBlob id = new IDlookBlob();

    id.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);/*from  ww w  .  jav a  2s  . c  om*/
        }
    });

    id.init();
    id.buildGUI();
}

From source file:EditorDropTarget2.java

public static void main(String[] args) {
    try {//from w w  w .j a  va  2s .co  m
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception evt) {
    }

    final JFrame f = new JFrame("JEditor Pane Drop Target Example 2");

    final JEditorPane pane = new JEditorPane();

    // Add a drop target to the JEditorPane
    EditorDropTarget2 target = new EditorDropTarget2(pane);

    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent evt) {
            System.exit(0);
        }
    });

    JPanel panel = new JPanel();
    final JCheckBox editable = new JCheckBox("Editable");
    editable.setSelected(true);
    panel.add(editable);
    editable.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            pane.setEditable(editable.isSelected());
        }
    });

    f.getContentPane().add(new JScrollPane(pane), BorderLayout.CENTER);
    f.getContentPane().add(panel, BorderLayout.SOUTH);
    f.setSize(500, 400);
    f.setVisible(true);
}