Java DisplayMode.hashCode()
Syntax
DisplayMode.hashCode() has the following syntax.
public int hashCode()
Example
In the following code shows how to use DisplayMode.hashCode() method.
//w w w. j a va2 s . c om
import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
public class Main {
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();
System.out.println(dmodes[i].hashCode());
}
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »