how do I get the actual screen position of an element, say a Button? If I use getBounds I get the position relative to the parent container, not the screen...
how do I get the actual screen position of an element, say a Button? If I use getBounds I get the position relative to the parent container, not the screen...
You can try this:
// Convert a coordinate relative to a component's bounds to screen coordinates
Point pt = new Point(component.getLocation());
SwingUtilities.convertPointToScreen(pt, component);