• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

jtree problem

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
im trying to change the jtree renderer to do the following:
each node in the tree should be on a panel which contains two lables,
the left label which is the node name and its icon, and the right label which would be a legend.
i already created that and it works,
the problem is that i want the legend label(the right label) to be aligned to the right of the tree, but i cant get it to work because it aligns label to the right of panel, but the panel itself isnt as wide as the tree component.
how can i tell jtree to set each of the nodes panels to be as wide as the jtree itself?

here's how it should look like:http://www16.brinkster.com/talgo/eg.jpg
this is what i get:http://www16.brinkster.com/talgo/current.jpg


thanks

[ April 16, 2006: Message edited by: Tal Goldstein ]
[ April 16, 2006: Message edited by: Tal Goldstein ]
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got this to work with custom TreeCellRenderer and BasicTreeUI classes. The minimum I could get by with in the UI code was this:

and set the ui after the tree was realized (no size data otherwise).
I put this together with the j2se 1.5 sdk and notice (in the docs) that there have been some changes (starting in 1.5).
 
Whatever. Here's a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic