0

In the case of a single monitor using java.awt.Toolkit.getDefaultToolkit().getScreenSize();

but In dual monitor what should I do now?

Adrian Shum
  • 38,812
  • 10
  • 83
  • 131
  • 2
    I believe you can find the answer here: http://stackoverflow.com/a/6322681/1175077 – jpw Nov 01 '13 at 01:53

1 Answers1

2

What you want is:

GraphicsDevice[] monitors = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();

Which will be a list of all the monitors attached to the system.

Those GraphicsDevice objects have a suite of useful methods.

Numeron
  • 8,723
  • 3
  • 21
  • 46
  • Thank you for your answer. For using your sentence, I only figured out the fact I'm using dual monitors. But what I really want to know is how can I figure out resolution of each monitors (ex) resolution of graphicsdevice[0] and graphicsdevice[1]). I'm waiting your answer! – SungJae Park Nov 03 '13 at 02:56
  • graphicsdevice[0].getDisplayMode().getWidth() and .getHeight() – Numeron Nov 03 '13 at 22:55