List of usage examples for java.lang Runnable Runnable
Runnable
From source file:de.h_da.fbi.rfid.gui.UHF_GUI.java
/** * @param args the command line arguments *//*from w w w . j ava 2 s.c o m*/ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(UHF_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(UHF_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(UHF_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(UHF_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new UHF_GUI("UHF-Reader", "Anzahl der Personen im Labor").setVisible(true); } }); }
From source file:edu.mit.fss.examples.TDRSSFederate.java
/** * The main method. This configures the Orekit data path, creates the * SaudiComsat federate objects and launches the associated graphical user * interface.//from w w w . j a va2 s . c o m * * @param args the arguments * @throws RTIexception the RTI exception * @throws URISyntaxException */ public static void main(String[] args) throws RTIexception, URISyntaxException { BasicConfigurator.configure(); logger.debug("Setting Orekit data path."); System.setProperty(DataProvidersManager.OREKIT_DATA_PATH, new File(TDRSSFederate.class.getResource("/orekit-data.zip").toURI()).getAbsolutePath()); logger.trace("Creating federate instance."); final TDRSSFederate federate = new TDRSSFederate(); logger.trace("Setting minimum step duration and time step."); long timeStep = 60 * 1000, minimumStepDuration = 100; federate.setMinimumStepDuration(minimumStepDuration); federate.setTimeStep(timeStep); logger.debug("Loading TLE data from file."); final List<Component> panels = new ArrayList<Component>(); for (String satName : Arrays.asList("TDRS 3", "TDRS 5", "TDRS 6", "TDRS 7", "TDRS 8", "TDRS 9", "TDRS 10", "TDRS 11")) { try { BufferedReader br = new BufferedReader(new InputStreamReader( federate.getClass().getClassLoader().getResourceAsStream("edu/mit/fss/examples/data.tle"))); while (br.ready()) { if (br.readLine().matches(".*" + satName + ".*")) { logger.debug("Found " + satName + " data."); logger.trace("Adding " + satName + " supplier space system."); SpaceSystem system = new SpaceSystem(satName, new TLE(br.readLine(), br.readLine()), 5123e3); federate.addObject(system); panels.add(new SpaceSystemPanel(federate, system)); try { logger.trace("Setting inital time."); federate.setInitialTime(system.getInitialState().getDate() .toDate(TimeScalesFactory.getUTC()).getTime()); } catch (IllegalArgumentException | OrekitException e) { logger.error(e.getMessage()); e.printStackTrace(); } break; } } br.close(); } catch (IllegalArgumentException | OrekitException | IOException e) { e.printStackTrace(); logger.fatal(e); } } try { logger.trace("Adding WSGT ground station."); SurfaceSystem wsgt = new SurfaceSystem("WSGT", new GeodeticPoint(FastMath.toRadians(32.5007), FastMath.toRadians(-106.6086), 1474), new AbsoluteDate(), 5123e3, 5); federate.addObject(wsgt); panels.add(new SurfaceSystemPanel(federate, wsgt)); logger.trace("Adding STGT ground station."); SurfaceSystem stgt = new SurfaceSystem("STGT", new GeodeticPoint(FastMath.toRadians(32.5430), FastMath.toRadians(-106.6120), 1468), new AbsoluteDate(), 5123e3, 5); federate.addObject(stgt); panels.add(new SurfaceSystemPanel(federate, stgt)); logger.trace("Adding GRGT ground station."); SurfaceSystem grgt = new SurfaceSystem("GRGT", new GeodeticPoint(FastMath.toRadians(13.6148), FastMath.toRadians(144.8565), 142), new AbsoluteDate(), 5123e3, 5); federate.addObject(grgt); panels.add(new SurfaceSystemPanel(federate, grgt)); } catch (OrekitException e) { logger.error(e.getMessage()); e.printStackTrace(); } logger.debug("Launching the graphical user interface."); try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { MemberFrame frame = new MemberFrame(federate, new MultiComponentPanel(panels)); frame.pack(); frame.setVisible(true); } }); } catch (InvocationTargetException | InterruptedException e) { logger.error(e.getMessage()); e.printStackTrace(); } logger.trace("Setting federate name, type, and FOM path."); federate.getConnection().setFederateName("TDRSS"); federate.getConnection().setFederateType("FSS Supplier"); federate.getConnection().setFederationName("FSS"); federate.getConnection().setFomPath( new File(federate.getClass().getClassLoader().getResource("edu/mit/fss/hla/fss.xml").toURI()) .getAbsolutePath()); federate.getConnection().setOfflineMode(false); federate.connect(); }
From source file:edu.ku.brc.specify.extras.FixSQLString.java
/** * @param args// w w w . j a v a 2 s . c om */ public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @SuppressWarnings("synthetic-access") public void run() { try { UIHelper.OSTYPE osType = UIHelper.getOSType(); if (osType == UIHelper.OSTYPE.Windows) { UIManager.setLookAndFeel(new PlasticLookAndFeel()); PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue()); } else if (osType == UIHelper.OSTYPE.Linux) { UIManager.setLookAndFeel(new PlasticLookAndFeel()); } } catch (Exception e) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(DataModelClassGenerator.class, e); //log.error("Can't change L&F: ", e); } FixSQLString fix = new FixSQLString(); fix.setVisible(true); } }); }
From source file:GUI.Data.java
/** * @param args the command line arguments *///from w w w. j ava 2 s . c om public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Data.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Data.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Data.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Data.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Data().setVisible(true); } }); }
From source file:muh.GrafikDeneme.java
/** * @param args the command line arguments *//*from w w w . ja v a2s . c o m*/ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(GrafikDeneme.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(GrafikDeneme.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(GrafikDeneme.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(GrafikDeneme.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new GrafikDeneme().setVisible(true); } }); }
From source file:misc.FocusTraversalDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {/*from w ww . j a v a 2s .com*/ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }
From source file:com.yosanai.java.swing.config.ConfigDialog.java
/** * @param args/*www . ja v a 2 s . co m*/ * the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { ConfigDialog dialog = new ConfigDialog(new javax.swing.JFrame(), true); dialog.setEditKey(true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); }
From source file:com.planetmayo.debrief.satc.util.StraightLineCullingTestForm.java
public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override/*from w w w.j av a 2s. c o m*/ public void run() { StraightLineCullingTestForm form = new StraightLineCullingTestForm(); form.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); form.setVisible(true); } }); }
From source file:com.cch.aj.entryrecorder.frame.CheckJFrame.java
/** * @param args the command line arguments *///from w ww .j ava 2 s . co m public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(CheckJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(CheckJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(CheckJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(CheckJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CheckJFrame().setVisible(true); } }); }
From source file:teambootje.A5.java
/** * @param args the command line arguments *//*from ww w.jav a 2 s.c o m*/ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(A5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(A5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(A5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(A5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new A5().setVisible(true); } }); }