How do I get the x y coordinates of a java swing table cell?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do I get the x y coordinates of a java swing table cell?
Just wondering if there is a way to get the x y coordinates of a cell in a java swing table, using jscript?
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have access to the developers? They are quite possibly the people to ask?
A quick google got me this:
http://docs.oracle.com/javase/7/docs/api/javax/swing/JTable.html#getCellRect(int,%20int,%20boolean)
... which looks like it might return/contain the type of info you're after? (heights, x/y's, etc) Not sure if they are absolute coordinates or relative to the container grid though.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
In addition to @Colin_McCrae’s reply, I recommend that you read the Accessing Native Methods of Java Objects article describing how to work with native Java methods and properties in TestComplete.
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yep. That may well be the case.
It sounds very similar to rhe "RECT" property of a TreeView Node object in Delphi. I need to use those to get co-ordinates relative to the tree container in order to apply a click to a custom checkbox.
But the RECT property is only available via the debug agent (in Delphi land). So what Tanya is saying makes sense to me.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Rectangle method worked to get me the x,y coordinates. Thanks
