Example usage for java.awt EventQueue invokeLater

List of usage examples for java.awt EventQueue invokeLater

Introduction

In this page you can find the example usage for java.awt EventQueue invokeLater.

Prototype

public static void invokeLater(Runnable runnable) 

Source Link

Document

Causes runnable to have its run method called in the #isDispatchThread dispatch thread of Toolkit#getSystemEventQueue the system EventQueue .

Usage

From source file:TabbedPaneTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {

            JFrame frame = new TabbedPaneFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);/*from w w w. j  a  va  2s.  c  om*/
        }
    });
}

From source file:RobotTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            // make frame with a button panel

            ButtonFrame frame = new ButtonFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);/*  w  ww  .  j a va2 s  .c o  m*/

            // attach a robot to the screen device

            GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
            GraphicsDevice screen = environment.getDefaultScreenDevice();

            try {
                Robot robot = new Robot(screen);
                runTest(robot);
            } catch (AWTException e) {
                e.printStackTrace();
            }
        }
    });
}

From source file:ZipTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            ZipTestFrame frame = new ZipTestFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);//from w  w w .  j  av  a2s .  c  o m
        }
    });
}

From source file:TextTransferTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            JFrame frame = new TextTransferFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);//from ww  w.j av  a 2  s.  c  o  m
        }
    });
}

From source file:SpinnerTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            SpinnerFrame frame = new SpinnerFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);/*  w w w  .  j  av a 2s  . com*/
        }
    });
}

From source file:SerialTransferTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            JFrame frame = new SerialTransferFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);/*from   w w  w  . j a  v  a2 s .c o m*/
        }
    });
}

From source file:InterruptibleSocketTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            JFrame frame = new InterruptibleSocketFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);/*from   w w w  .j  a v  a2 s  .  c  o  m*/
        }
    });
}

From source file:DataExchangeTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            DataExchangeFrame frame = new DataExchangeFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);/*ww  w  .  j  a v a 2s .  co m*/
        }
    });
}

From source file:FileChooserTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            ImageViewerFrame frame = new ImageViewerFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);/*from www .ja v  a  2  s. com*/
        }
    });
}

From source file:SwingDnDTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            JFrame frame = new SwingDnDFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);//from www  .java  2 s. c o m
        }
    });
}