帮忙看看 谢谢了
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import java.awt.*;
import java.awt.event.*;public class Set implements ActionListener { public static void main(String[] args) {
    new  Tree();
}
}
class Tree implements TreeSelectionListener {
JEditorPane editorpane;

public Tree() {
JFrame f = new JFrame("系统设置");
Container contentPane = f.getContentPane();
DefaultMutableTreeNode root1 = new DefaultMutableTreeNode("系统设置");
DefaultMutableTreeNode note1 = new DefaultMutableTreeNode("修改密码");
root1.add(note1);

JTree tree = new JTree(root1);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addTreeSelectionListener(this);

JScrollPane scrollpane1 = new JScrollPane(tree);
JScrollPane scrollpane2 = new JScrollPane(editorpane);
JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,scrollpane1,scrollpane2);
contentPane.add(splitpane);
f.setBounds(400, 400, 450, 420);
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}


public void valueChanged(TreeSelectionEvent e) {
JTree tree = (JTree) e.getSource();
DefaultMutableTreeNode selectionNode = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
String cmd = selectionNode.toString();

                   if (selectionNode.isLeaf()) {


if (cmd.equals("修改密码")) {                  //我想在这显示一个修改密码的界面 JPanel password = new JPanel(new GridLayout(2,2));
password.add(new JLabel("输入原来密码:"));
JPasswordField opwd = new JPasswordField();
password.add(opwd);
password.add(new JLabel("输入新密码:"));
JPasswordField npwd1 = new JPasswordField();
password.add(npwd1);
password.add(new JLabel("新密码确认:"));
JPasswordField npwd2 = new JPasswordField();
password.add(npwd2);
}
}
}

}