📄 fill.jvt
字号:
import
org.eclipse.swt.SWT
org.eclipse.swt.layout.FillLayout
org.eclipse.swt.widgets.Button
org.eclipse.swt.widgets.Display
org.eclipse.swt.widgets.Group
org.eclipse.swt.widgets.Shell
org.eclipse.swt.widgets.Text
method
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell();
shell.setLayout(new FillLayout(SWT.HORIZONTAL));
shell.setText("FillLayout test");
{
final Button button = new Button(shell, SWT.NONE);
button.setText("button");
}
{
final Group group = new Group(shell, SWT.NONE);
group.setLayout(new FillLayout(SWT.VERTICAL));
group.setText("Group");
{
final Button button = new Button(group, SWT.NONE);
button.setText("button 1");
}
{
final Button button = new Button(group, SWT.NONE);
button.setText("button 2");
}
{
final Button button = new Button(group, SWT.NONE);
button.setText("button 3");
}
}
{
final Text text = new Text(shell, SWT.BORDER | SWT.MULTI);
text.setText("text");
}
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -