📄 testenv.java
字号:
package com.jixy.baseOnSWT;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class TestEnv {
private static Text helloworldText;
/**
* Launch the application
*
* @param args
*/
public static void main(String[] args) {
final Display display = Display.getDefault();
final Shell jixy_shell = new Shell();
jixy_shell.setSize(500, 375);
jixy_shell.setText("SWT Application");
//TODO add some parameter
// TableViewer tv;
jixy_shell.open();
System.out.println("hello, SWT world!");
final Composite composite = new Composite(jixy_shell, SWT.NONE);
composite.setBounds(0, 10, 100, 26);
helloworldText = new Text(composite, SWT.BORDER);
helloworldText.setBounds(0, 0,80, 25);
helloworldText.setText("HelloWorld");
jixy_shell.layout();
while (!jixy_shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -