Import org. Eclipse. SWT. Widgets. display;
Import org. Eclipse. SWT. Widgets. shell;
Import org. Eclipse. SWT. SWT;
Public class shelldemo {
- /**
* @ Param ARGs
*/
Public static void main (string [] ARGs ){
// Todo auto-generated method stub
// Input a display object, which is an item-level window
// Set the window style to SWT. shell_trim.
Display display = New Display ();
Shell topshell = new shell (
Display, SWT. shell_trim );
Topshell. settext ("top-level window ");
Topshell. setsize (300,200); // you can specify the window size.
Topshell. open ();
// Input a shell object, which is a dialog box window.
// Set the window style to SWT. dialog_trim.
Shell dialogshell = new shell (topshell, SWT. dialog_trim );
Dialogshell. settext ("dialog box ");
Dialogshell. setsize (200,150 );
Dialogshell. open ();
While (! Topshell. isdisposed ())
{
If (! Display. readanddispatch ())
{
Display. Sleep ();
}
}
Display. Sleep ();
}
}