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

[1602 byte] By [sunnymanmana] at [2007-11-27 3:44:45]
# 1
You have to use Windows look and feel instead of Java look and feel. http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#display
it_senthilkumara at 2007-7-12 8:48:25 > top of Java-index,Desktop,Core GUI APIs...