Java Swing Tutorial - Java GraphicsDevice.getIDstring()


GraphicsDevice.getIDstring() has the following syntax.

public abstract String getIDstring()


In the following code shows how to use GraphicsDevice.getIDstring() method.

import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
//from  www  . ja v  a  2s .c o m
public class Main {

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

The code above generates the following result.