I'm creating a chess game using Java (I'm using Swing features) and I was wondering if there is a way to get the exact location of the mouse cursor. I tried both the MouseEvent location and the java.awt.MouseInfo and in both cases the JLabel I was dragging was trailing behind the cursor. Is there a way to get the exact location? I already tried:
e.getLocationOnScreen();
MouseInfo.getPointerInfo().getLocation();
(e is the MouseEvent)
Thanks in advance