Java:Monitore

Aus Alexander's Wiki
Zur Navigation springen Zur Suche springen
private void getNumberOfDisplaysAndResolution() {
  GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice[] gs = ge.getScreenDevices();

  for (int i = 0; i < gs.length; i++) {
    DisplayMode dm = gs[i].getDisplayMode();
    System.out.println("W: " + dm.getWidth());
    System.out.println("H: " + dm.getHeight());
  }
}