Once you recieve a MouseEvent is there a way that you can get the X and Y coordinate relative to the entire screen and not just to the source component? I have done it by going through all of the Parents of the components until I get the top parent frame and then using its x and y , but want to know if there is a simpeler way. Thanks
posted 15 years ago
You can use SwingUtilities.convertPointToScreen(Point p, Component c) method to convert a point relative to a component to a point relative to screen. Check out the documentation for more information.