Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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).
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic