Results 1 to 1 of 1
-
Updating a progress bar from the UI thread
Java Code:import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.ProgressBar; import org.eclipse.swt.widgets.Shell; public class Snippet57 { public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); ProgressBar bar = new ProgressBar (shell, SWT.SMOOTH); bar.setBounds (10, 10, 200, 32); shell.open (); for (int i=0; i<=bar.getMaximum (); i++) { try {Thread.sleep (100);} catch (Throwable th) {} bar.setSelection (i); } while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
Updating a SWT progress bar from another thread
By Java Tip in forum SWTReplies: 0Last Post: 07-11-2008, 04:51 PM -
Placing a progress bar in a SWT table
By Java Tip in forum SWTReplies: 0Last Post: 07-07-2008, 04:59 PM -
how to implement progress bar .....
By roshithmca in forum AWT / SwingReplies: 1Last Post: 03-06-2008, 04:18 PM -
Console Progress Bar
By new_2_java in forum New To JavaReplies: 1Last Post: 02-16-2008, 02:18 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks