swt如何实现分行显示

来源:百度知道 编辑:UC知道 时间:2024/07/02 17:51:15
swt如何实现分行显示,就像邮箱的那样,每行前面有个打钩的,选中就可以进行操作。

这个例子可以实现那个功能

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

public class Snippet181
{
private static Table tableSelect;

public static void main(String[] args)
{
Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(null);
final Table table = new Table(shell, SWT.BORDER | SWT.CHECK);
table.setBounds(10, 10, 114, 266);
table.setHeaderVisible(true);
TableColumn column = new TableColumn(table, SWT.LEFT);
column.setText("Column 0");
column = new TableColumn(table, SWT.CENTER);
column.setText("Column 1");
column = new TableColumn(table, SWT.CENTER);
column.setText("Column 2");
column = new TableColumn(tabl