-
Getting Coordinates Of Selected JTree Node
Hi,
I have a JTree where user can edit the XML nodes. User can edit the node by double clicking on the node or by pressing enter on the node.
When the user double clicks the node i am able to retrieve the x and y coordinates but when the users presses enter i am not able to retrieve the coordinates where the users presses the enter.
Is there any method of JTree where i can fetch the coordinates of a selected node or is there any method of fetching coordinates on keypress.
Thanks in advance,
Cheers :-)
Akshat
Last edited by akkiboys; 01-25-2006 at 01:52 AM.
-
Ans: Getting the coordinates of a selected JTree Node
// xmlTree is the instace of JTree.
Point p = xmlTree.getRowBounds(xmlTree.getRowForPath(currentSelection)).getLocation();
// Now convert this points to screen points
SwingUtilities.convertPointToScreen(p, this);
Cheers
Akshat
Similar Threads
-
By akkiboys in forum Java
Replies: 1
Last Post: 12-15-2005, 11:21 AM
-
By JamesOfOOST in forum Java
Replies: 2
Last Post: 03-14-2005, 10:05 AM
-
By Russell Jones in forum XML
Replies: 0
Last Post: 10-19-2001, 02:28 PM
-
By Russell Jones in forum XML
Replies: 0
Last Post: 10-17-2001, 12:46 PM
-
Replies: 0
Last Post: 07-20-2001, 08:42 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|