当前位置: 代码迷 >> J2SE >> jTree1.addTreeSelectionListener(this);cannot be applied解决办法
  详细解决方案

jTree1.addTreeSelectionListener(this);cannot be applied解决办法

热度:255   发布时间:2016-04-24 15:43:40.0
jTree1.addTreeSelectionListener(this);cannot be applied
DefaultMutableTreeNode   root   =   new   DefaultMutableTreeNode( "信用卡系统 ");
DefaultMutableTreeNode   bitchThing   =   new   DefaultMutableTreeNode( "查询 ");
root.add(bitchThing);
bitchThing   =   new   DefaultMutableTreeNode( "存款 ");
root.add(bitchThing);
bitchThing   =   new   DefaultMutableTreeNode( "取款 ");
root.add(bitchThing);
jTree1   =   new   JTree(root);
jSplitPane1.add(jTree1,   JSplitPane.LEFT);
jTree1.addTreeSelectionListener(this);
int   mode   =   TreeSelectionModel.SINGLE_TREE_SELECTION;
jTree1.getSelectionModel().setSelectionMode(mode);
这一句:jTree1.addTreeSelectionListener(this);
老提示cannot   be   applied  
请问是什么问题啊?

------解决方案--------------------
你这个this的类没有implements TreeSelectionListener
  相关解决方案