Zolf
asked on
show tooltip next to Jtree
Hello there,
I have created a JTree which gets populated from the database.Now i want to add a small description next to the nodes.How can i do this.for example.
-root (server)
-child (linecard)
-leaf (****)
ASKER
thanks for your comments.instead of bring the mouse over the nodes to display the words,i want it be next to the nodes visible permanently without using mouse.
then use a custom cell renderer.
ASKER
can you give me some example please
ASKER
thanks objects for that site.that is exactly what i need.but when i when though the code,it is typed into the node like that
Person a1 = new Person("Jack (great-granddaddy)");
in my case it is like this
ResultSet tables = state.executeQuery("SELECT
String tableName;
DefaultMutableTreeNode tableNode,tableNode1,table
while(tables.next()) // For each table
{
tableName = tables.getString("CITY_ENG
int cityID = tables.getInt("CITY_ID");
tableNode = new DefaultMutableTreeNode(tab
dbNode.add(tableNode);
well you can either set the text your require to be display in your tree node
or, create a new class that stores all the required details for the node, and use a custom cell renderer to format it as required
or, create a new class that stores all the required details for the node, and use a custom cell renderer to format it as required
ASKER
well you can either set the text your require to be display in your tree node
how can i achieve your first option.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://forum.java.sun.com/thread.jspa?threadID=687942&messageID=4008039
David