Changeset 264 for trunk/tests/SWT/java
- Timestamp:
- Nov 10, 2010, 3:46:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/SWT/java/SWT009_10.java
r259 r264 4 4 5 5 /* 6 * Copyright (c) 2002, 20 07EclipseOS2 Team.6 * Copyright (c) 2002, 2010 EclipseOS2 Team. 7 7 * This file is made available under the terms of the Common Public License v1.0 8 8 * which accompanies this distribution, and is available at … … 31 31 32 32 void initComponents() { 33 final ProgressBar pb = new ProgressBar(shell, SWT.HORIZONTAL); 34 // pb.setMinimum(0); 35 // pb.setMaximum(100); 36 // pb.setSelection(50); 37 // pb.setBounds(10, 10, 200, 20); 38 shell.pack(); 39 shell.open(); 40 33 final ProgressBar bar =new ProgressBar(shell,SWT.HORIZONTAL); 34 bar.setBounds(0, 0, 200, 20); 35 shell.pack(); 36 shell.open(); 37 final int maximum = bar.getMaximum(); 38 new Thread() { 39 public void run() { 40 for (int i = 1; i <= maximum; i++) { 41 try { 42 Thread.sleep(100); 43 } catch (Throwable th) { 44 } 45 final int index = i; 46 display.asyncExec(new Runnable() { 47 public void run() { 48 bar.setSelection(index); 49 } 50 }); 51 } 52 } 53 }.start(); 41 54 } 42 43 44 55 void setTitle(String title) { 45 56 super.setTitle(title);
Note:
See TracChangeset
for help on using the changeset viewer.