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