/*******************************************************************************
* Copyright (c) 2004 Berthold Daum. All rights reserved. This program and the
* accompanying materials are made available under the terms of the Common
* Public License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors: Berthold Daum
******************************************************************************/
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
publicclass widgetTest {
publicstaticvoid main(String[] args) {
// Create Display instance
final Display display = new Display();
// Create top level Shell (pass display as parent)
final Shell toplevelShell = new Shell(display);
// Set title line
toplevelShell.setText("TopLevel.Titelzeile");
// Display shell
toplevelShell.open();
// Create a dialog shell (pass toplevelShell as parent)
final Shell dialogShell = new Shell(toplevelShell);
// Set title line
dialogShell.setText("Dialog.Titelzeile");
// Display shell
dialogShell.open();
// Wait until top level shell is closed
while (!toplevelShell.isDisposed()) {
// Check for waiting events
if (!display.readAndDispatch())
display.sleep();
}
}
}