I am writing a program designed to work on a two monitor system. I have to separate JFrame objects, and have it so be default, the first frame instance opens. The user then has to drag that frame over to a specific monitor, or leave it in place. When they click a button on that frame, I want the program to open up the second frame on the opposite monitor.
So, How would I figure out which monitor a frame object is on, and then tell another frame object to open on the opposite one?
Looking up GraphicsEnvironment, you can easily find out the bounds and location of each screen. After that, it is just a matter of playing with the location of the frames.
See small demo example code here:
Yet, consider reading carefully The Use of Multiple JFrames, Good/Bad Practice? because they bring very interesting considerations.