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:gtu._work.ui.JSFMakerUI.java

/**
 * Auto-generated main method to display this JFrame
 *//*from ww w . ja v a2 s  .  com*/
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            JSFMakerUI inst = new JSFMakerUI();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:gtu._work.ui.RegexDirReplacer.java

/**
 * Auto-generated main method to display this JFrame
 *//*from w  w w  .  j a v  a2 s .c  om*/
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            RegexDirReplacer inst = new RegexDirReplacer();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:gtu.log.finder.ExceptionLogFinderUI.java

/**
 * Auto-generated main method to display this JFrame
 *///ww w  .j a  v a2  s . c om
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            ExceptionLogFinderUI inst = new ExceptionLogFinderUI();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:gtu._work.ui.SqlCreaterUI.java

/**
 * Auto-generated main method to display this JFrame
 */// ww  w .ja  v a 2s . c o  m
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            SqlCreaterUI inst = new SqlCreaterUI();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:gtu._work.ui.JarFinderUI.java

/**
 * Auto-generated main method to display this JFrame
 *///w  w w  . j  a  va2  s  .  c  o m
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            JarFinderUI inst = new JarFinderUI();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:br.usp.poli.lta.cereda.macro.Application.java

/**
 * Mtodo principal./*from  ww  w .ja v  a2s.  com*/
 * @param args Argumentos de linha de comando.
 */
public static void main(String[] args) {

    // imprime banner
    System.out.println(StringUtils.repeat("-", 50));
    System.out.println(StringUtils.center("Expansor de macros", 50));
    System.out.println(StringUtils.repeat("-", 50));
    System.out.println(StringUtils.center("Laboratrio de linguagens e tcnicas adaptativas", 50));
    System.out.println(StringUtils.center("Escola Politcnica - Universidade de So Paulo", 50));
    System.out.println();

    try {

        // faz o parsing dos argumentos de linha de comando
        CLIParser parser = new CLIParser(args);
        Pair<String, File> pair = parser.parse();

        // se o par no  nulo,  possvel prosseguir com a expanso
        if (pair != null) {

            // obtm a expanso do texto fornecido na entrada
            String output = MacroExpander.parse(pair.getFirst());

            // se foi definido um arquivo de sada, grava a expanso do
            // texto nele, ou imprime o resultado no terminal, caso
            // contrrio
            if (pair.getSecond() != null) {
                FileUtils.writeStringToFile(pair.getSecond(), output, Charset.forName("UTF-8"));
                System.out.println("Arquivo gerado com sucesso.");
            } else {
                System.out.println(output);
            }

        } else {

            // verifica se a execuo corresponde a uma chamada ao editor
            // embutido de macros
            if (parser.isEditor()) {

                // cria o editor e exibe
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        DisplayUtils.init();
                        Editor editor = new Editor();
                        editor.setVisible(true);
                    }
                });
            }
        }
    } catch (Exception exception) {

        // ocorreu uma exceo, imprime a mensagem de erro
        System.out.println(StringUtils.rightPad("ERRO: ", 50, "-"));
        System.out.println(WordUtils.wrap(exception.getMessage(), 50));
        System.out.println(StringUtils.repeat(".", 50));
    }
}

From source file:javazoom.jlgui.player.amp.StandalonePlayer.java

/**
 * @param args/* w w  w .j  av a 2 s. co m*/
 */
public static void main(String[] args) {
    final StandalonePlayer player = new StandalonePlayer();
    player.parseParameters(args);
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            player.loadUI();
            player.loadJS();
            player.loadPlaylist();
            player.boot();
        }
    });
}

From source file:misc.TablePrintDemo2.java

/**
 * Start the application.//from ww  w . j av a  2 s . c  o  m
 */
public static void main(final String[] args) {
    /* Schedule for the GUI to be created and shown on the EDT */
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            /* Don't want bold fonts if we end up using metal */
            UIManager.put("swing.boldMetal", false);
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
            }
            new TablePrintDemo2().setVisible(true);
        }
    });
}

From source file:gtu._work.etc._3DSMovieRenamer.java

/**
 * Auto-generated main method to display this JFrame
 *//*from  w  ww .  j  a  v a  2 s . c o  m*/
public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            _3DSMovieRenamer inst = new _3DSMovieRenamer();
            inst.setLocationRelativeTo(null);
            gtu.swing.util.JFrameUtil.setVisible(true, inst);
        }
    });
}

From source file:misc.GradientTranslucentWindowDemo.java

public static void main(String[] args) {
    // Determine what the GraphicsDevice can support.
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gd = ge.getDefaultScreenDevice();
    boolean isPerPixelTranslucencySupported = gd.isWindowTranslucencySupported(PERPIXEL_TRANSLUCENT);

    //If translucent windows aren't supported, exit.
    if (!isPerPixelTranslucencySupported) {
        System.out.println("Per-pixel translucency is not supported");
        System.exit(0);//from   w w  w. j  a  v a  2s  .co  m
    }

    JFrame.setDefaultLookAndFeelDecorated(true);

    // Create the GUI on the event-dispatching thread
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            GradientTranslucentWindowDemo gtw = new GradientTranslucentWindowDemo();

            // Display the window.
            gtw.setVisible(true);
        }
    });
}