zoukankan      html  css  js  c++  java
  • 在SWT的table中或在JFace的TableViewer中添加checkbox

    (1)如果是在第一列,则可以使用SWT.CHECK 样式来实现,例如:

           Table table = new Table(parent, SWT.CHECK);

    (2)如果不是第一列,则可以使用TableEditor,创建一个Control悬浮在CellEditor之上,例如:

           TableEditor editor = new TableEditor(table);
           Button button = new Button(table, SWT.CHECK);
           button.pack();
           editor.minimumWidth = button.getSize().x;
           editor.horizontalAlignment = SWT.LEFT;
           editor.setEditor(button, items[i], 2);

    Demo连接:

    http://www.java2s.com/Tutorial/Java/0280__SWT/TableCellEditorComboTextandButton.htm

  • 相关阅读:
    新浪微博采用Oauth发送图片和文字
    android proguard也有弱点
    POJ 2376
    POJ 3259
    POJ 2253
    POJ 1062
    POJ 2299
    POJ 2186
    POJ 1860
    POJ 2823
  • 原文地址:https://www.cnblogs.com/finalstar/p/2725259.html
Copyright © 2011-2022 走看看