OnJava8-Examples/swt/ShellsAreMainWindows.java

28 lines
696 B
Java
Raw Normal View History

2015-09-07 11:44:36 -06:00
// swt/ShellsAreMainWindows.java
2015-11-14 16:18:05 -08:00
// <20>2016 MindView LLC: see Copyright.txt
2015-06-15 17:47:35 -07:00
import org.eclipse.swt.widgets.*;
public class ShellsAreMainWindows {
static Shell[] shells = new Shell[10];
public static void main(String [] args) {
Display display = new Display();
for(int i = 0; i < shells.length; i++) {
shells[i] = new Shell(display);
shells[i].setText("Shell #" + i);
shells[i].open();
}
while(!shellsDisposed())
if(!display.readAndDispatch())
display.sleep();
display.dispose();
}
static boolean shellsDisposed() {
for(Shell shell : shells) {
if(shell.isDisposed()) {
return true;
}
}
return false;
}
2015-09-07 11:44:36 -06:00
}