📄 table.jvt
字号:
import
org.eclipse.swt.SWT
org.eclipse.swt.layout.FillLayout
org.eclipse.swt.widgets.Display
org.eclipse.swt.widgets.Shell
org.eclipse.swt.widgets.Table
org.eclipse.swt.widgets.TableColumn
method
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell();
shell.setLayout(new FillLayout());
shell.setText("Table test");
{
final Table table = new Table(shell, SWT.BORDER | SWT.CHECK | SWT.FULL_SELECTION | SWT.MULTI);
table.setLinesVisible(true);
table.setHeaderVisible(true);
{
final TableColumn tableColumn = new TableColumn(table, SWT.NONE);
tableColumn.setWidth(100);
tableColumn.setText("First column");
}
{
final TableColumn tableColumn = new TableColumn(table, SWT.CENTER);
tableColumn.setWidth(200);
tableColumn.setText("Center column");
}
{
final TableColumn tableColumn = new TableColumn(table, SWT.RIGHT);
tableColumn.setWidth(150);
tableColumn.setText("Right column");
}
}
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -