List the display's color depth, DPI : Device « SWT « Java Tutorial






import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class DeviceDPI {
  public static void main(String[] args) {
    final Display display = new Display();
    final Shell shell = new Shell(display);

    Device device = shell.getDisplay();

    System.out.println("getDepth(): " + device.getDepth());
    System.out.println("getDPI(): " + device.getDPI());

    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    display.dispose();

  }
}








17.119.Device
17.119.1.List the display's boundaries, client area
17.119.2.List the display's color depth, DPI
17.119.3.Whether or not it supports printing warnings