Java examples for 2D Graphics:GraphicsDevice
get Default Graphics Device
//package com.java2s; import java.awt.DisplayMode; import java.awt.Frame; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; public class Main { public static GraphicsDevice getDefaultGraphicsDevice(Frame frame, int bitDepth, int frequency) { DisplayMode displayMode = new DisplayMode(frame.getWidth(), frame.getHeight(), bitDepth, frequency); GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice graphicsDevice = graphicsEnvironment .getDefaultScreenDevice(); graphicsDevice.setFullScreenWindow(frame); graphicsDevice.setDisplayMode(displayMode); return graphicsDevice; }/* ww w .ja va 2s.c om*/ }