Convert a coordinate relative to a component's bounds to screen coordinates
import java.awt.Point; import javax.swing.JButton; import javax.swing.SwingUtilities; public class Main { public static void main(String[] argv) { JButton component = new JButton(); Point pt = new Point(component.getLocation()); SwingUtilities.convertPointToScreen(pt, component); } }