File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JTree reduce indent for leaf node Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree reduce indent for leaf node" Watch "JTree reduce indent for leaf node" New topic
Author

JTree reduce indent for leaf node

jenita brown
Ranch Hand

Joined: Feb 20, 2007
Posts: 51
Hello,

JTree indents the leaf nodes more then a normal node. I want to override this action and get all the children aligned, irrespective of node type.

<pre>
what jtree does by default
root
|
+child1
|
+child2
|
---child3

where child3 is a leaf node


what I want is

root
|
+child1
|
+child2
|
child3
</pre>
Waiting for your reply.

Thank you.

Regards,

Jenal
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2152
    
    7
Don't you have the answer from the other posting you hijacked?

Seems to me lack an indent of 0 does what you want.

If it doesn't work then you will need to write your own UI. So look at the code to see where those UIManager properties are used and then customize it for your requirements.

If you need further help then you need to create a SSCCE (Short, Self Contained, Compilable and Executable, Example Program), that demonstrates the incorrect behaviour.

Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTree reduce indent for leaf node
 
Similar Threads
sort jtree
Jtree child selection problem
JTree
JTree last selected path component is giving null
URGENT :- Creating JTree