All pastes #364709 Raw Edit

Someone

public text v1 · immutable
#364709 ·published 2007-02-20 10:30 UTC
rendered paste body
public class Main3 {
  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new FillLayout());

    final Table t = new Table(shell, SWT.MULTI);

    final TableItem i1 = new TableItem(t, SWT.NONE);
    i1.setText("FOOO");

    final TableItem i2 = new TableItem(t, SWT.NONE);
    i2.setText("BAAAR");

    TableItem i3 = new TableItem(t, SWT.NONE);
    i3.setText("asdasdasd");

    Button b = new Button(shell, SWT.NONE);
    b.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        TableItem[] selection = t.getSelection();
        for (TableItem item : selection) {
          item.dispose();
        }
      }
    });

    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
  }
}