当前位置: 代码迷 >> Eclipse >> swt tree如何去掉虚线呢
  详细解决方案

swt tree如何去掉虚线呢

热度:36   发布时间:2016-04-23 14:18:32.0
swt tree怎么去掉虚线呢?
RT..
谢谢!~~~

------解决方案--------------------
你看这样行不行:
Java code
import org.eclipse.swt.SWT;import org.eclipse.swt.layout.FillLayout;import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Shell;import org.eclipse.swt.widgets.Tree;import org.eclipse.swt.widgets.TreeItem;public class TreeSample {    public static void main(String[] args) {        Display display = new Display();        Shell shell = new Shell(display);        shell.setLayout(new FillLayout());        Tree tree = new Tree(shell, SWT.FULL_SELECTION );        TreeItem root = new TreeItem(tree, SWT.NULL);        root.setText("root");        for (int i = 0; i < 10; i++) {            TreeItem item = new TreeItem(root, SWT.NULL);            item.setText("Item"+i);        }        shell.open();        while (!shell.isDisposed())            if (!display.readAndDispatch())                display.sleep();        display.dispose();    }}
  相关解决方案