• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic