This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom JTree addings

 
Luciano Terreri
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, i have this problem:

I have a class A , in which i define my DefaultMutableTreeNode:




I add element on with a method that receive a parameter from another class B:



This methods receive a string, it is the user's nickname.
Now my problem is:
I want to modify this method to add on this JTree some others items, like 1 ImageIcon (for each node, a custom icon), the String s, and another String b.
How can i do?
I saw some threads that indicate to use TreeCellRenderer, but i am not able to use this TreeCellRenderer in my case.

Can you help me please?

Bye
 
Michael Dunn
Ranch Hand
Posts: 4632
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic