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:ToolBarTest.java

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

From source file:ConsoleWindowTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            // this is the button test program from chapter 8
            ButtonFrame frame = new ButtonFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);/*  w  w  w.j a  v a2s  .  c  o  m*/

            // initialize the console window--System.out will show here
            ConsoleWindow.init();
        }
    });
}

From source file:PropertiesTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            PropertiesFrame frame = new PropertiesFrame();
            frame.setVisible(true);// w ww  . j  a va2 s .com
        }
    });
}

From source file:ActionTest.java

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

From source file:SwingThreadTest.java

public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            SwingThreadFrame frame = new SwingThreadFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);//from   w w w  .j ava2s. co m
        }
    });
}

From source file:SplitPaneTest.java

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

From source file:ColorChooserTest.java

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

From source file:org.opendatakit.briefcase.ui.MainClearBriefcasePreferencesWindow.java

/**
 * Launch the application./*  w w  w  .j  a  va 2s.  c  o  m*/
 */
public static void main(String[] args) {

    EventQueue.invokeLater(new Runnable() {
        public void run() {
            try {
                // Set System L&F
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                Image myImage = Toolkit.getDefaultToolkit().getImage(
                        MainClearBriefcasePreferencesWindow.class.getClassLoader().getResource("odk_logo.png"));
                Object[] options = { "Purge", "Cancel" };
                int outcome = JOptionPane.showOptionDialog(null,
                        "Clear all Briefcase preferences.                                            ",
                        CLEAR_PREFERENCES_VERSION, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE,
                        new ImageIcon(myImage), options, options[1]);
                if (outcome == 0) {
                    BriefcasePreferences.setBriefcaseDirectoryProperty(null);
                }
            } catch (Exception e) {
                log.error("failed to launch app", e);
            }
        }
    });
}

From source file:TextComponentTest.java

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

From source file:MouseTest.java

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