?? shelltest.java
字號:
package demo;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class ShellTest extends Shell {
/**
* Launch the application
* @param args
*/
public static void main(String args[]) {
try {
Display display = Display.getDefault();
ShellTest shell = new ShellTest(display, SWT.SHELL_TRIM);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the shell
* @param display
* @param style
*/
public ShellTest(Display display, int style) {
super(display, style);
createContents();
}
/**
* Create contents of the window
*/
protected void createContents() {
setText("SWT Application");
setSize(500, 375);
final Button button = new Button(this, SWT.NONE);
button.setText("button");
button.setBounds(137, 271, 48, 22);
}
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -