import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
public class Test
...{
public static void main(String[] args)
...{
Display display = new Display();

/**//*
* Create a Shell with the default style i.e. full screen, no decoration
* on PocketPC. Alternative: 'new Shell(display, SWT.CLOSE)' to get the
* Pocket PC 'Ok' button.
*/
Shell shell = new Shell(display);

/**//*
* Set a text so that the top level Shell also appears in the Pocket PC
* task list
*/
shell.setText("HelloWorld");

/**//*
* Set a menubar to follow UI guidelines on Pocket PC
*/
Menu mb = new Menu(shell, SWT.BAR);
shell.setMenuBar(mb);

/**//*
* Add widgets
*/
FillLayout layout = new FillLayout();
layout.type = SWT.VERTICAL;
shell.setLayout(layout);
Label label = new Label(shell, SWT.CENTER);
label.setText("Hello World");
shell.open();
while (!shell.isDisposed())
...{
if (!display.readAndDispatch())
display.sleep();
}
}
}
937

被折叠的 条评论
为什么被折叠?



