怎么没人告诉我啊~~~!急啊~~明天要交毕业设计程序了      :~(

解决方案 »

  1.   

    import java.awt.BorderLayout;import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.tree.TreePath;public class TreeTest
    { public static void main(String[] args)
    {
    JTree tree = new JTree() {
    public boolean isPathEditable(TreePath path)
    {
    String name = path.getLastPathComponent().toString();
    if (name.equals("blue")) {
    return false;
    }
    return true;
    }
    };
    tree.setEditable(true);
    JScrollPane sp = new JScrollPane(tree);
    JFrame f = new JFrame();
    f.getContentPane().add(sp, BorderLayout.CENTER);
    f.setSize(400, 400);
    f.setLocationRelativeTo(null);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);
    }
    }
      

  2.   

    在节点编辑了,怎么改边不了了。鼠标再点到其他地方去里面的值又回过去了