Package java.awt

Examples of java.awt.Frame.addWindowListener()


public class DeviceIdentificationTest {

    public static void main(String args[]) {
        final Frame f = new Frame("DeviceIdentificationTest");
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                f.dispose();
            }
        });
        f.addComponentListener(new ComponentAdapter() {
View Full Code Here


            public void update(Graphics g) {}
        };
        frame.setBackground(bgColor);
        frame.pack();
        frame.setSize(FRAME_W, FRAME_H);
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                done = true;
            }
        });
        try {
View Full Code Here

            else
                canvas = (GLCanvas) drawable;

            final Frame window = new Frame();

            window.addWindowListener(new java.awt.event.WindowAdapter() {
                @Override
                public void windowClosing(java.awt.event.WindowEvent windowevent) {
                    animator.stop();
                    window.remove(canvas);
                    window.dispose();
View Full Code Here

        canvas = new GLCanvas(new GLCapabilities(GLProfile.get(GLProfile.GL2)));
        canvas.addGLEventListener(this);
        initSceneInteraction();

        Frame frame = new Frame("JOCL Multi Device Mandelbrot Set");
        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                MultiDeviceFractal.this.release(e.getWindow());
            }
        });
View Full Code Here

            f = new Frame ("BSF Result: " + inFileName);
            f.add ((java.awt.Component) obj);
                                            }
                                           
                                            // Add a window listener to quit on closing.
                                            f.addWindowListener(
                                                                new WindowAdapter () {
                                                                    public void windowClosing (WindowEvent e) {
                                                                        System.exit (0);
                                                                    }
                                                                });
View Full Code Here

            String as[] = par2Str.split(":");
            minecraftimpl.setServer(as[0], Integer.parseInt(as[1]));
        }

        frame.setVisible(true);
        frame.addWindowListener(new GameWindowListener(minecraftimpl, thread));
        thread.start();
    }

    /**
     * get the client packet send queue
View Full Code Here

            throws InterruptedException {
        final String headless = System.getProperty("java.awt.headless", "false");
        if (!headless.equalsIgnoreCase("true") && TestData.isInteractiveTest()) {
            try {
                Frame frame = new Frame(testName);
                frame.addWindowListener(new WindowAdapter() {

                    public void windowClosing(WindowEvent e) {
                        e.getWindow().dispose();
                    }
                });
View Full Code Here

        final String headless = System.getProperty("java.awt.headless", "false");
        if (!headless.equalsIgnoreCase("true") && TestData.isInteractiveTest()) {
            try {
                Frame frame = new Frame(testName);
                frame.addWindowListener(new WindowAdapter() {

                    public void windowClosing(WindowEvent e) {
                        e.getWindow().dispose();
                    }
                });
View Full Code Here

    public static void runTests(boolean showresults) {
        final TestEnvironment env = new TestEnvironment();
        Frame f = null;
        if (showresults) {
            f = new Frame("J2DBench test run");
            f.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    env.stop();
                }
            });
            f.add(env.getCanvas());
View Full Code Here

        if (((System.getProperty("java.awt.headless") == null) || !System.getProperty(
                "java.awt.headless").equals("true"))
                && INTERACTIVE) {
            Frame frame = new Frame(frameName);
            frame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    e.getWindow().dispose();
                }
            });
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.