如何展开指定的TreeViewer节点,急!!!!!! 如题! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import org.eclipse.swt.layout.GridLayout;import org.eclipse.swt.graphics.Point;import org.eclipse.swt.widgets.Shell;import org.eclipse.swt.widgets.Tree;import org.eclipse.swt.widgets.TreeItem;import org.eclipse.swt.SWT;import org.eclipse.swt.graphics.Rectangle;public class Tree_yyc { private Shell sShell = null; private Tree tree = null; /** * This method initializes sShell */ private void createSShell() { sShell = new Shell(); sShell.setText("Shell"); sShell.setSize(new Point(300, 200)); sShell.setLayout(null); tree = new Tree(sShell, SWT.NONE); tree.setBounds(new Rectangle(2, 3, 81, 165)); for(int loopIndex1 = 2000; loopIndex1 <= 2008; loopIndex1++) { TreeItem item0 = new TreeItem(tree, 0); item0.setText("Year " + loopIndex1); for(int loopIndex2 = 1; loopIndex2 <= 12; loopIndex2++) { TreeItem item1 = new TreeItem(item0, 0); item1.setText("Month " + loopIndex2); } } }} GUI鼠标事件 基础问题 程序有错 大家挑挑 问个String的问题,大家帮我解答一下 如何获得windows整个桌面内容 简单的小问题,帮忙看看,谢谢! JAVA连接mysql数据库的问题 关于JTextArea或TextArea? 寻找UDP编程示例 用jbulider编译后的exe文件能否脱离jvm工作? pdf文件不能打印,该如何解决?<jbuilder的开发指南> 将一个字符串变为二维数组 真的没人懂吗?????????一个毕业设计题目都没人懂???
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Rectangle;public class Tree_yyc { private Shell sShell = null;
private Tree tree = null; /**
* This method initializes sShell
*/
private void createSShell() {
sShell = new Shell();
sShell.setText("Shell");
sShell.setSize(new Point(300, 200));
sShell.setLayout(null);
tree = new Tree(sShell, SWT.NONE);
tree.setBounds(new Rectangle(2, 3, 81, 165));
for(int loopIndex1 = 2000; loopIndex1 <= 2008; loopIndex1++) { TreeItem item0 = new TreeItem(tree, 0); item0.setText("Year " + loopIndex1); for(int loopIndex2 = 1; loopIndex2 <= 12; loopIndex2++) { TreeItem item1 = new TreeItem(item0, 0); item1.setText("Month " + loopIndex2);
} }
}
}