I have seen many people asking how you can get the mouse location on screen. Before Java SE 6, a
MouseEvent can only tell you where the mouse is in coordinates relative to the component that issued the event. Even though you can combine the
Component.getLocationOnScreen() to discover the mouse location in screen coordinates, you are better off using java.awt.MouseInfo. Just invoke
getPointerInfo() to receive an instance of java.awt.PointerInfo that will give you not only the location you were looking for but also the screen device on which the mouse cursor is. Extremely valuable to have high quality dual-screen (or more) support.