Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Different Icons for JTree

 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that i can generally replace idons in a jtree for leaves, open, closed etc. but can I have specific icons for specific nodes/leaves? In otherwords, is it possible that in a large tree each item could be graphically represented in a different way (not just the three basic ways that are given)? An example might be an athletic association where they would want to represent each team on the 'tree' by their mascot. If possible, how would you do this. Can this be set in the node or is it set in the tree?
 
Author
Posts: 978
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is handled by the renderer.
 
Sheriff
Posts: 22655
126
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Brian Cole:
It is handled by the renderer.


I'd modify the body just slightly:

Because you are now assuming behaviour (the return this part) that might someday change.
 
reply
    Bookmark Topic Watch Topic
  • New Topic