get GraphicsDevice - Java java.awt

Java examples for java.awt:GraphicsDevice

Description

get GraphicsDevice

Demo Code


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

import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;

public class Main {
    public static GraphicsDevice getDevice(int screenNo)
            throws AWTException {
        GraphicsEnvironment env = GraphicsEnvironment
                .getLocalGraphicsEnvironment();
        GraphicsDevice device = env.getScreenDevices()[screenNo];
        return device;
    }//  w  w  w . ja v  a  2s .c  o  m
}

Related Tutorials