There are many questions / answers about using GraphicsEnvironment to do similar things.
You can use GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() to get all monitors, then call GraphicsDevice#getConfigurations and then GraphicsConfiguration#getBounds to get the size and location of each monitor, and then use high school geometry to find the "right" monitor. (Please note that the actual setup of multiple monitors may place them in an arbitrary location.)
Geoffrey zheng
source share