How to replace original JTree node with + and - sign or icon?
Dear friends:
I have following code for JTree:
import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTree;
publicclass TreeSample{
publicstaticvoid main(String args[]){
JFrame f =new JFrame("JTree Sample");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container content = f.getContentPane();
JTree tree =new JTree();
JScrollPane scrollPane =new JScrollPane(tree);
content.add(scrollPane, BorderLayout.CENTER);
f.setSize(300, 200);
f.setVisible(true);
}
}
Here, when I click any node to explore its children, right handle pointer become down handle Pointer, but if I hope to change this right handle pointer to + sign or icon; and to change this down handle pointer to - sign or icon; how to do it, ?
Is there any simplest way instead of using ImageIcon ?
Thanks
sunny

