Java Utililty Methods Screen Number

List of utility methods to do Screen Number

Description

The list of methods to do Screen Number are organized into topic(s).

Method

intgetMonitorNumberAtLocation(Point pos)
get Monitor Number At Location
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice screenDevices[] = ge.getScreenDevices();
for (int i = 0; i < screenDevices.length; i++) {
    final GraphicsDevice device1 = screenDevices[i];
    GraphicsConfiguration gc = device1.getDefaultConfiguration();
    Rectangle screenBounds = gc.getBounds();
    if (screenBounds.contains(pos)) {
        return i;
...
intgetNumberOfScreenDevices()
Returns number of screens in current machine
return GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices().length;
intgetNumberOfScreens()
get Number Of Screens
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
    GraphicsDevice[] gs = ge.getScreenDevices();
    return gs.length;
} catch (HeadlessException e) {
    return 0;
intgetNumberOfScreens()
Returns the number of screens.
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gd = ge.getScreenDevices();
return gd.length;