Here is an image of my application:
As you can see, there is a JTable in there. I need to get the location of the headers of the JTable relative to the JFrame that it is in.
Why might I be doing this? I am adding a help feature that explains what each of the columns in the table is for. It puts a spotlight on each column. It looks like this:
As you can see, the location where the spotlight is showing is off.
To get the location, I get the Rectangle
of the column header using:
getTable().getTableHeader().getHeaderRect(i);
To convert this Rectangle
to the correct location in the JFrame, I use:
Point point = SwingUtilities.convertPoint(
component, //the containing JPanel
rectangle.getLocation(), //the rectangle for the table column header
frame.getGlassPane()); //the containing JFrame
Can someone help me with getting the correct location of the column header?