tags:

views:

146

answers:

2

Hello, 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...

+2  A: 

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); 
Bobby
+5  A: 

Have you tried Component.getLocationOnScreen()?

bruno conde
perfect. sorry I was in a hurry and I didn't notice it. Tnx
gotch4