Example usage for java.awt GraphicsEnvironment getScreenDevices

List of usage examples for java.awt GraphicsEnvironment getScreenDevices

Introduction

In this page you can find the example usage for java.awt GraphicsEnvironment getScreenDevices.

Prototype

public abstract GraphicsDevice[] getScreenDevices() throws HeadlessException;

Source Link

Document

Returns an array of all of the screen GraphicsDevice objects.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {

    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] gs = ge.getScreenDevices();
    for (int i = 0; i < gs.length; i++) {
        Robot robot = new Robot(gs[i]);

    }//from ww w  .  java 2s  .  c o  m
}

From source file:Main.java

public static void main(String[] args) {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] defaultScreens = ge.getScreenDevices();

}

From source file:Main.java

public static void main(String[] a) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] screenDevices = ge.getScreenDevices();
    for (int i = 0; i < screenDevices.length; i++)
        System.out.println(screenDevices[i].getIDstring());
}

From source file:Main.java

public static void main(String[] argv) throws Exception {

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

    for (int i = 0; i < gs.length; i++) {
        DisplayMode dm = gs[i].getDisplayMode();
        int screenWidth = dm.getWidth();
        int screenHeight = dm.getHeight();
    }/*w  w w . j  a  v  a 2  s .c  om*/

}

From source file:Main.java

public static void main(String[] args) {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] gs = ge.getScreenDevices();
    for (int j = 0; j < gs.length; j++) {
        GraphicsDevice gd = gs[j];
        System.out.println("Device " + j + ": " + gd);
        GraphicsConfiguration[] gc = gd.getConfigurations();
        for (int i = 0; i < gc.length; i++) {
            System.out.println(gc[i]);
            System.out.println(gc[i].getBounds());
        }//from   w w  w . ja  v a2 s .  c  om
    }
}

From source file:MainClass.java

public static void main(String[] a) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] screenDevices = ge.getScreenDevices();
    for (int i = 0; i < screenDevices.length; i++) {
        GraphicsDevice s = screenDevices[i];
        System.out.println(s.getAvailableAcceleratedMemory());
    }/*from w w  w  .  j a  va 2  s.  c o m*/
}

From source file:MainClass.java

public static void main(String[] a) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] screenDevices = ge.getScreenDevices();
    for (int i = 0; i < screenDevices.length; i++) {
        GraphicsDevice s = screenDevices[i];
        System.out.println(s.getIDstring());
    }//from w w w  .  ja v  a2  s  .c om
}

From source file:Main.java

public static void main(String[] argv) throws Exception {

    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] gs = ge.getScreenDevices();
    for (int i = 0; i < gs.length; i++) {
        VolatileImage im = gs[i].getDefaultConfiguration().createCompatibleVolatileImage(1, 1);
        int bytes = gs[i].getAvailableAcceleratedMemory();
        if (bytes < 0) {
            System.out.println("Amount of memory is unlimited");
        }//from  w ww.ja  v a 2  s. c  om

        im.flush();
    }
}

From source file:Main.java

public static void main(String[] argv) throws Exception {

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

    for (int i = 0; i < gs.length; i++) {
        DisplayMode dm = gs[i].getDisplayMode();

        int refreshRate = dm.getRefreshRate();
        if (refreshRate == DisplayMode.REFRESH_RATE_UNKNOWN) {
            System.out.println("Unknown rate");
        }/*from ww  w  .j  av a 2s  .com*/

        int bitDepth = dm.getBitDepth();
        int numColors = (int) Math.pow(2, bitDepth);
    }
}

From source file:Main.java

public static void main(String[] argv) throws Exception {

    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    try {// ww  w . ja v  a  2s . com
        GraphicsDevice[] gs = ge.getScreenDevices();

        int numScreens = gs.length;
    } catch (HeadlessException e) {

    }
}