Example usage for java.awt GraphicsDevice getDisplayModes

List of usage examples for java.awt GraphicsDevice getDisplayModes

Introduction

In this page you can find the example usage for java.awt GraphicsDevice getDisplayModes.

Prototype

public DisplayMode[] getDisplayModes() 

Source Link

Document

Returns all display modes available for this GraphicsDevice .

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();

    DisplayMode[] dmodes = gs.getDisplayModes();
    for (int i = 0; i < dmodes.length; i++) {
        int bitDepth = dmodes[i].getBitDepth();

    }//from  www.  j ava2 s  . c  om
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();

    DisplayMode[] dmodes = gs.getDisplayModes();
    for (int i = 0; i < dmodes.length; i++) {
        int refreshRate = dmodes[i].getRefreshRate();

    }//from  w w  w  . j a va  2 s .  c  o  m
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();

    DisplayMode[] dmodes = gs.getDisplayModes();
    for (int i = 0; i < dmodes.length; i++) {
        DisplayMode dm = dmodes[i];
        int bitDepth = dm.getBitDepth();

    }//www  .j a  va  2s .  co  m
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();

    DisplayMode[] dmodes = gs.getDisplayModes();
    for (int i = 0; i < dmodes.length; i++) {
        int screenWidth = dmodes[i].getWidth();
        int screenHeight = dmodes[i].getHeight();

    }/*from   www  .j  a v  a  2 s .c  om*/
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();

    DisplayMode[] dmodes = gs.getDisplayModes();
    for (int i = 0; i < dmodes.length; i++) {
        DisplayMode dm = dmodes[i];
        int refreshRate = dm.getRefreshRate();
        System.out.println(refreshRate);
    }//from w  w w  .j av  a 2 s .  co m
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();

    DisplayMode[] dmodes = gs.getDisplayModes();
    for (int i = 0; i < dmodes.length; i++) {
        DisplayMode dm = dmodes[i];
        int screenWidth = dm.getWidth();
        System.out.println(screenWidth);
    }//from  w w  w  .  j ava 2 s .  co  m
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();

    DisplayMode[] dmodes = gs.getDisplayModes();
    for (int i = 0; i < dmodes.length; i++) {
        DisplayMode dm = dmodes[i];
        if (dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI) {
            System.out.println("DisplayMode.BIT_DEPTH_MULTI");
        }//  w w w  .  j  a  v a  2  s  . c o m
    }
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();

    DisplayMode[] dmodes = gs.getDisplayModes();
    for (int i = 0; i < dmodes.length; i++) {
        DisplayMode dm = dmodes[i];
        int screenWidth = dm.getWidth();
        int screenHeight = dm.getHeight();

        System.out.println(screenWidth);
        System.out.println(screenHeight);
    }/*  w  w  w. j  av  a  2  s.  c o m*/
}

From source file:FullScreen.java

private static DisplayMode getBestDisplayMode(GraphicsDevice device) {
    for (int x = 0, xn = MODES.length; x < xn; x++) {
        DisplayMode[] modes = device.getDisplayModes();
        for (int i = 0, in = modes.length; i < in; i++) {
            if (modes[i].getWidth() == MODES[x].getWidth() && modes[i].getHeight() == MODES[x].getHeight()
                    && modes[i].getBitDepth() == MODES[x].getBitDepth()) {
                return MODES[x];
            }/* w ww  .j  a va  2s .com*/
        }
    }
    return null;
}

From source file:MultiBufferTest.java

private static DisplayMode getBestDisplayMode(GraphicsDevice device) {
    for (int x = 0; x < BEST_DISPLAY_MODES.length; x++) {
        DisplayMode[] modes = device.getDisplayModes();
        for (int i = 0; i < modes.length; i++) {
            if (modes[i].getWidth() == BEST_DISPLAY_MODES[x].getWidth()
                    && modes[i].getHeight() == BEST_DISPLAY_MODES[x].getHeight()
                    && modes[i].getBitDepth() == BEST_DISPLAY_MODES[x].getBitDepth()) {
                return BEST_DISPLAY_MODES[x];
            }//  w  w w  .j  av  a2  s. c o m
        }
    }
    return null;
}