How to get numbers of monitors
Asked Answered
C

1

6

There are 2 monitors attached to my computer and I want to count them programmatically. How to do that with Java?

Carmine answered 7/8, 2014 at 10:6 Comment(1)
docs.oracle.com/javase/7/docs/api/java/awt/…Aminoplast
C
9

Try next:

GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
System.out.println(localGraphicsEnvironment.getScreenDevices().length);
Christman answered 7/8, 2014 at 10:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.