I found that in my JTable (which is located in the JScrollPane nested in the JInternalFrame), I might have problems scrolling and resizing when the JTable is larger than the JScrollPane.
Basically, if the frame is on my left monitor, but I have scrolled the table all the way to the right, a pop-up window appears on my right monitor.
I looked at the results of four different options: getMousePositions () for both the frame and the scroll pane, plus the getX and getXOnScreen () mouse events.
The only one that gave me the results I wanted was getMousePositions () for the frame. Everything else was offset by my own inner view of the world, which makes sense to me.
So, I think I'm saying, be careful when you get the coordinates of your mouse.
source share