| 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
|
 |
 |
|
|
subject: How to get the bounds of a node in JTree
|
|
|