Get all display mode

Source code below will display all display mode in your computer include their width, height, refresh rate and bit depth.

********************************************
COMPLETE SOURCE CODE FOR : AllDisplayMode.java
********************************************


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

public class AllDisplayMode
{
public static void main(String[]args)
{
GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd=ge.getDefaultScreenDevice();
DisplayMode[]allDisplayMode=gd.getDisplayModes();

int temp=0;

while(temp<allDisplayMode.length)
{
System.out.println("DISPLAY MODE : "+(temp+1));
System.out.println("Width : "+allDisplayMode[temp].getWidth()+" pixels");
System.out.println("Height : "+allDisplayMode[temp].getHeight()+" pixels");
System.out.println("Refresh rate : "+allDisplayMode[temp].getRefreshRate()+" Hz");
System.out.println("BitDepth : "+allDisplayMode[temp].getBitDepth()+" bit");
System.out.println("\n");
temp=temp+1;
}
}
}


********************************************
JUST COMPILE AND EXECUTE IT
********************************************

RELAXING NATURE VIDEO