Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2005

Tip: Looking for answers? Try searching our database.

How to add spacer nodes/blank nodes to a JTree.

Thread view: 
joe.rabbit@earthlink.net - 11 Feb 2005 19:57 GMT
Is there a way to add a spacer node to a JTree?

For example:

Root
|
+--- Child 1
|
+--- Child 2
|
+--- child 3

I want it to show up as

Root
|
+--- Child 1
|
| << Empty space here >>
|
+--- Child 2
|
+--- child 3

I can always add an empty node but the display doesn't look correct.
Looks something like this.

Root
|
+--- Child 1
|
+---  << empty node >>
|
+--- Child 2
|
+--- child 3

Notice the connecting lines. I know I can turn off the lines but I was
looking for another way. Any ideas?
Andrey Kuznetsov - 11 Feb 2005 21:24 GMT
> Is there a way to add a spacer node to a JTree?

don't add spacer node, but increase height of Child 1.

"public int getRowHeight()
Returns the height of each row.
If the returned value is less than or equal to 0
the height for each row is determined by the renderer."
                                                                  ^^^^^^
Signature

Andrey Kuznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.