List of usage examples for javax.swing SwingUtilities invokeLater
public static void invokeLater(Runnable doRun)
From source file:de.topobyte.livecg.LiveCG.java
public static void main(String[] args) { // @formatter:off Options options = new Options(); OptionHelper.add(options, OPTION_CONFIG, true, false, "path", "config file"); // @formatter:on CommandLineParser clp = new GnuParser(); CommandLine line = null;/* w ww .ja v a 2s .c o m*/ try { line = clp.parse(options, args); } catch (ParseException e) { System.err.println("Parsing command line failed: " + e.getMessage()); new HelpFormatter().printHelp(HELP_MESSAGE, options); System.exit(1); } StringOption config = ArgumentHelper.getString(line, OPTION_CONFIG); if (config.hasValue()) { String configPath = config.getValue(); LiveConfig.setPath(configPath); } Configuration configuration = PreferenceManager.getConfiguration(); String lookAndFeel = configuration.getSelectedLookAndFeel(); if (lookAndFeel == null) { lookAndFeel = UIManager.getSystemLookAndFeelClassName(); } try { UIManager.setLookAndFeel(lookAndFeel); } catch (Exception e) { logger.error("error while setting look and feel '" + lookAndFeel + "': " + e.getClass().getSimpleName() + ", message: " + e.getMessage()); } Content content = null; String filename = "res/presets/Startup.geom"; String[] extra = line.getArgs(); if (extra.length > 0) { filename = extra[0]; } ContentReader reader = new ContentReader(); InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(filename); try { content = reader.read(input); } catch (Exception e) { logger.info("unable to load startup geometry file", e); logger.info("Exception: " + e.getClass().getSimpleName()); logger.info("Message: " + e.getMessage()); } final LiveCG runner = new LiveCG(); final Content c = content; SwingUtilities.invokeLater(new Runnable() { @Override public void run() { runner.setup(true, c); } }); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { runner.frame.requestFocus(); } }); }
From source file:com.brainflow.application.toplevel.Brainflow.java
public static void main(String[] args) { final Brainflow bflow = getInstance(); SwingUtilities.invokeLater(new Runnable() { public void run() { try { log.info("Launching Brainflow ..."); bflow.launch();//w ww. j av a2s . co m } catch (Throwable e) { Logger.getAnonymousLogger().severe("Error Launching Brainflow, exiting"); e.printStackTrace(); System.exit(-1); } } }); }
From source file:ChooseDropActionDemo.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); createAndShowGUI();/*from w w w . j ava2 s.com*/ } }); }
From source file:Flipper.java
public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new Flipper(); }/* w w w . ja va2 s . c o m*/ }); }
From source file:QandE.Flipper2.java
public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new Flipper2(); }//from w w w.j a v a2 s . c o m }); }
From source file:gtu._work.mvn.MavenRepositoryUI.java
/** * Auto-generated main method to display this JFrame */// w w w . j av a 2 s.c om public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { MavenRepositoryUI inst = new MavenRepositoryUI(); inst.setLocationRelativeTo(null); gtu.swing.util.JFrameUtil.setVisible(true, inst); } }); }
From source file:de.freese.base.swing.mac_os_x.MyApp.java
/** * @param args String[][]//from w w w .j av a 2 s. c om */ public static void main(final String[] args) { SwingUtilities.invokeLater(new Runnable() { /** * @see java.lang.Runnable#run() */ @Override public void run() { System.setProperty("apple.laf.useScreenMenuBar", "true"); new MyApp().setVisible(true); } }); }
From source file:brainflow.app.toplevel.BrainFlow.java
public static void main(String[] args) { final BrainFlow bflow = get(); //Class myClass = BrainFlow.class; //URL url = myClass.getResource("BrainFlow.class"); //System.out.println("class located: " + url); SwingUtilities.invokeLater(new Runnable() { public void run() { try { log.info("Launching BrainFlow ..."); bflow.launch();/*from ww w . j a v a2 s . co m*/ } catch (Throwable e) { Logger.getAnonymousLogger().severe("Error Launching BrainFlow, exiting"); e.printStackTrace(); System.exit(-1); } } }); }
From source file:ModalMessage.java
public static void main(String args[]) { final ModalMessage mm = new ModalMessage("duh\nduh\nduh", false); SwingUtilities.invokeLater(new Runnable() { public void run() { mm.setVisible(true);/*from w w w .j a va2 s . com*/ } }); SwingUtilities.invokeLater(new Runnable() { public void run() { mm.appendText("another line"); mm.setEnabled(true); } }); }
From source file:com.lcdfx.pipoint.PiPoint.java
public static void main(final String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new PiPoint(args); frame.setTitle(APPLICATION_NAME); frame.setIconImage(/* www .j av a 2 s. co m*/ new ImageIcon(PiPoint.class.getResource("/resources/pipoint_icon.png")).getImage()); frame.pack(); frame.setVisible(true); } }); }