| |
17. 4. 23. The modal state of shells: APPLICATION_MODAL, MODELESS, PRIMARY_MODAL, SYSTEM_MODAL |
|
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class ShellApplicationModal {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display,SWT.APPLICATION_MODAL);
shell.setLayout(new FillLayout());
shell.open();
// Set up the event loop.
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
// If no more entries in event queue
display.sleep();
}
}
display.dispose();
}
}
|
|
|