Example usage for javax.swing SwingUtilities invokeLater

List of usage examples for javax.swing SwingUtilities invokeLater

Introduction

In this page you can find the example usage for javax.swing SwingUtilities invokeLater.

Prototype

public static void invokeLater(Runnable doRun) 

Source Link

Document

Causes doRun.run() to be executed asynchronously on the AWT event dispatching thread.

Usage

From source file:io.github.eternalbits.compactvd.CompactVD.java

public static void main(String[] args) throws Exception {

    DiskImageJournal.scanDirectory(Static.getWorkingDirectory());

    if (args.length == 0 && !GraphicsEnvironment.isHeadless()) {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        SwingUtilities.invokeLater(new Runnable() {
            @Override//from w  w w  .j  a v  a  2 s.  c  om
            public void run() {
                new FrontEnd();
            }
        });
        return;
    }

    new CompactVD().commandLine(args);

}

From source file:components.TextFieldDemo.java

public static void main(String args[]) {
    //Schedule a job for the event dispatch thread:
    //creating and showing this application's GUI.
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            //Turn off metal's use of bold fonts
            UIManager.put("swing.boldMetal", Boolean.FALSE);
            new TextFieldDemo().setVisible(true);
        }// w  ww  . j av  a 2  s.co  m
    });
}

From source file:TextAreaDemo.java

public static void main(String args[]) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            // Turn off metal's use of bold fonts
            UIManager.put("swing.boldMetal", Boolean.FALSE);
            new TextAreaDemo().setVisible(true);
        }//  w w  w. java  2 s. co m
    });
}

From source file:cnu.eslab.fileTest.NewJFrame.java

public static void main(String[] args) {
    @SuppressWarnings("unused")
    NewJFrame aa = new NewJFrame();

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            NewJFrame inst = new NewJFrame();
            inst.setLocationRelativeTo(null);
            inst.setVisible(true);/*  ww w. ja  v  a 2  s  .  c om*/
        }
    });

}

From source file:projects.tgas.exec.HrDiagram.java

/**
 * Main application entry point.//from   ww w.ja v a  2 s  .co m
 * @param args
 *    The args - ignored.
 */
public static void main(String[] args) {

    final JFrame frame = new JFrame("TGAS HR diagram");

    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setLayout(new BorderLayout());
            frame.add(new HrDiagram(), BorderLayout.CENTER);
            frame.setSize(1500, 750);
            frame.pack();
            frame.setVisible(true);
        }
    });
}

From source file:com.streamhub.StreamHubLicenseGenerator.java

public static void main(String[] args) {
    JFrame.setDefaultLookAndFeelDecorated(true);

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            try {
                UIManager.setLookAndFeel(new SubstanceGraphiteLookAndFeel());
            } catch (Exception e) {
                System.out.println("Substance Graphite failed to initialize");
            }//w ww.  j a va  2  s.  c om
            StreamHubLicenseGenerator w = new StreamHubLicenseGenerator();
            w.setVisible(true);
        }
    });
}

From source file:com.att.aro.ui.view.MainFrame.java

/**
 * Launch the application.//w ww  . j a  v  a2s. co  m
 */
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            try {
                window = new MainFrame();
                window.frmApplicationResourceOptimizer.setVisible(true);
                setLocationMap();
            } catch (Exception e) {
                e.printStackTrace();
            }
            final SplashScreen splash = new SplashScreen();
            splash.setVisible(true);
            splash.setAlwaysOnTop(true);
            new SwingWorker<Object, Object>() {
                @Override
                protected Object doInBackground() {
                    try {
                        Thread.sleep(2000);
                    } catch (InterruptedException e) {
                    }
                    return null;
                }

                @Override
                protected void done() {
                    splash.dispose();
                }
            }.execute();

            new Thread(() -> {
                if (window.ffmpegConfirmationImpl.checkFFmpegExistance() == false) {
                    SwingUtilities.invokeLater(() -> window.launchDialog(new FFmpegConfirmationDialog()));
                }
            }).start();

            new Thread(() -> {
                if (Util.isMacOS() && !window.pcapConfirmationImpl.checkPcapVersion()) {
                    SwingUtilities.invokeLater(() -> window.launchDialog(new PcapConfirmationDialog()));
                }
            }).start();
        }
    });
}

From source file:TextFieldDemo.java

public static void main(String args[]) {
    // Schedule a job for the event dispatch thread:
    // creating and showing this application's GUI.
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            // Turn off metal's use of bold fonts
            UIManager.put("swing.boldMetal", Boolean.FALSE);
            new TextFieldDemo().setVisible(true);
        }/*from   w  w  w.java2  s  .  c om*/
    });
}

From source file:BooksDemo.java

public static void main(String argv[]) {
    final BooksDemo xframe = new BooksDemo();
    xframe.setVisible(true);//from   w  w w. j ava2  s. c om
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            xframe.createScene();
        }
    });
}

From source file:financepro.XYLineChartExample.java

License:asdf

public static void main(String[] args) {

    SwingUtilities.invokeLater(new Runnable() {
        @Override/*  www  .j  a  v a2s  .  co  m*/
        public void run() {
            new XYLineChartExample(Company).setVisible(true);
        }
    });
}