public static void main(String args[]) { System.setProperty("swing.defaultlaf", "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); TimingSource ts = new SwingTimerTimingSource(); Animator.setDefaultTimingSource(ts); ts.init(); Runnable doCreateAndShowGUI = new Runnable() { public void run() { new RaceCompleteMultiStep("Swing Race (Multi-Step)"); } }; SwingUtilities.invokeLater(doCreateAndShowGUI); }
public static void main(String[] args) { final Display display = Display.getDefault(); final Shell shell = new Shell(display); shell.setText("SWT Triggers"); final TimingSource ts = new SWTTimingSource(display); Animator.setDefaultTimingSource(ts); ts.init(); createAndShowGUI(shell); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } ts.dispose(); display.dispose(); }