AutoRelease学习

public static void main (String [] args) {
    Display display = new Display ();
    Shell shell = new Shell(display);
    
    Text helloWorldTest = new Text(shell, SWT.NONE);
    helloWorldTest.setText("Hello World SWT");
    helloWorldTest.pack();
    
    shell.pack();
    shell.open ();
    while (!shell.isDisposed ()) {
        if (!display.readAndDispatch ()) display.sleep ();
    }
    display.dispose ();
}

你可能感兴趣的:(AutoRelease学习)