aspose file tools
The moose likes Swing / AWT / SWT and the fly likes How to get the bounds of a node in JTree Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "How to get the bounds of a node in JTree" Watch "How to get the bounds of a node in JTree" New topic
Author

How to get the bounds of a node in JTree

Nagarajan Thangapandi
Greenhorn

Joined: Mar 18, 2008
Posts: 9
I need to get bounds of a node in the JTree. Can some one tell me how to get that.

Thanks in advance.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8575

Nagarajan,
Welcome to the Ranch.

The DefaultMutableTreeNode i.e. the "node" represents the data. What you see on the screen, will be the renderer.
Once you identified your node, you will have to figure out the corresponding renderer and then get it's bounds.

[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19232

Check out the JTree API. There are two methods that return a Rectangle; both start with "get" and end with "Bounds()".


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get the bounds of a node in JTree
 
Similar Threads
JTree
JTree
JTree
JTree
JTree