I need the x
and y
coordinates of the table because I want to draw an object over the table. Is it possible to draw a canvas object over a table at all?
Asked
Active
Viewed 1,529 times
4

aterai
- 9,658
- 4
- 35
- 44

user3824834
- 43
- 5
-
Do you just want an image tooltip, something like [this](http://stackoverflow.com/a/22246185/2587435)? – Paul Samsotha Jul 25 '14 at 09:59
-
What do you mean by "canvas object"? Have you consider using the glass pane or JXLayer? – MadProgrammer Jul 25 '14 at 10:30
-
@MadProgrammer :-) `glass pane or JXLayer` ???= JViewport – mKorbel Jul 25 '14 at 10:58
-
@mkorbel without more context, it's difficult to suggest, but JXLayer could be made to fit over the JTabel... – MadProgrammer Jul 25 '14 at 11:11
1 Answers
4
You can get the coordinates of a cell by calling:
Rectangle r = JTable.getCellRect(row, column, includeSpacing);

icza
- 389,944
- 63
- 907
- 827