Java Graphics Settings getDefaultGraphicsConfiguration()

Here you can find the source of getDefaultGraphicsConfiguration()

Description

get Default Graphics Configuration

License

Open Source License

Declaration

private static GraphicsConfiguration getDefaultGraphicsConfiguration() 

Method Source Code


//package com.java2s;
import java.awt.*;

public class Main {
    /** Tells wether this WM may support acceleration of some images */
    private static boolean VM_SUPPORTS_ACCELERATION = true;

    private static GraphicsConfiguration getDefaultGraphicsConfiguration() {
        try {/*from w ww  .j av a  2  s  .c o m*/
            GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
            if (!env.isHeadlessInstance()) {
                return env.getDefaultScreenDevice().getDefaultConfiguration();
            }
        } catch (LinkageError e) {
            // Means we are not in a 1.4+ VM, so skip testing for headless again
            VM_SUPPORTS_ACCELERATION = false;
        }
        return null;
    }
}

Related

  1. getDefaultConfig()
  2. getDefaultConfiguration()
  3. getDefaultGraphicsConfiguration()
  4. getDefaultGraphicsConfiguration()
  5. getMaxWindowBounds(final GraphicsConfiguration gc, final boolean applyScreenInsets)
  6. getRenderingHints(final Graphics2D g2d, final Map hintsToSave, Map savedHints)