• Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom JTree addings  RSS feed

Luciano Terreri
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?

Michael Dunn
Ranch Hand
Posts: 4632
Maneesh Godbole
Posts: 11445
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!