eclipse 已经安装好了swt-designer插件 30
eclipse已经安装好了swt-designer插件要怎么才能把那个工具箱调出来就像vb控件那种工具箱可以直接拖出来用...
eclipse 已经安装好了swt-designer插件 要怎么才能把那个工具箱调出来 就像vb控件那种工具箱 可以直接拖出来用
展开
1个回答
展开全部
AWT的?
SWING的我知道.
DefaulMutableTreeNode root = DefaultableTreeNode("根节点");
......
JTree jTree1 = new JTree(root);
jTree1.addTreeSelectionListener(new Frame1_jTree1_treeSelectionAdapter(this));
class Frame1_jTree1_treeSelectionAdapter implements TreeSelectionListener{
private TreeFrame adaptee;
Frame1_jTree1_treeSelectionAdapter(TreeFrame adaptee){
this.adaptee = adaptee;
}
public void valueChanged(TreeSelectionEvent e){
adaptee.jTree1_valueChanged(e);
}
}
public void jTree1_valueChanged(TreeSelectionEvent e){
DefaulMutableTreeNode node = (DefaulMutableTreeNode)jTree1.getLastSelectedpathcomponent();//得到你选择的节点
String name = node.getUserObject().toString();//得到节点的名这样就可以根据选择不同的名来做不同的事
......
}
SWING的我知道.
DefaulMutableTreeNode root = DefaultableTreeNode("根节点");
......
JTree jTree1 = new JTree(root);
jTree1.addTreeSelectionListener(new Frame1_jTree1_treeSelectionAdapter(this));
class Frame1_jTree1_treeSelectionAdapter implements TreeSelectionListener{
private TreeFrame adaptee;
Frame1_jTree1_treeSelectionAdapter(TreeFrame adaptee){
this.adaptee = adaptee;
}
public void valueChanged(TreeSelectionEvent e){
adaptee.jTree1_valueChanged(e);
}
}
public void jTree1_valueChanged(TreeSelectionEvent e){
DefaulMutableTreeNode node = (DefaulMutableTreeNode)jTree1.getLastSelectedpathcomponent();//得到你选择的节点
String name = node.getUserObject().toString();//得到节点的名这样就可以根据选择不同的名来做不同的事
......
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询