看来目前有可能从中获取它
java.awt.GraphicsEnvironment。这是在最新JDK(8u112)上运行的注释代码示例。
// find the display device of interestfinal GraphicsDevice defaultScreenDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();// on OS X, it would be CGraphicsDeviceif (defaultScreenDevice instanceof CGraphicsDevice) { final CGraphicsDevice device = (CGraphicsDevice) defaultScreenDevice; // this is the missing correction factor, it's equal to 2 on HiDPI a.k.a. Retina displays final int scaleFactor = device.getScaleFactor(); // now we can compute the real DPI of the screen final double realDPI = scaleFactor * (device.getXResolution() + device.getYResolution()) / 2;}


