Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic