0

I'm trying open a JDialog in current screen using dual screens. However, the dialog always open in main screen.

To get the screens I'm using this code:

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] screens = ge.getScreenDevices();

I need to know which monitor I'm running the application, and force the dialog to open in current screen.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
ecost4
  • 11
  • 1
  • 2
  • 2
    possible duplicate of [How to detect the current display with Java?](http://stackoverflow.com/questions/2234476/how-to-detect-the-current-display-with-java) – rghome Jun 30 '15 at 09:46
  • Check this elegant answer.... [Is there a way to take a screenshot using Java and save it to some sort of image?](http://stackoverflow.com/questions/58305/is-there-a-way-to-take-a-screenshot-using-java-and-save-it-to-some-sort-of-image) – Jordi Castilla Jun 30 '15 at 09:50
  • Hopefully, this [thread](http://stackoverflow.com/q/14273836/1057230), might be of some help, on the topic :-) – nIcE cOw Jun 30 '15 at 11:28

0 Answers0