For Javascript, you can use it this way in code:
var width = new Array(); var height = new Array(); var screens = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); for(var i = 0;i<screens.length; i++){ var config = screens[i].getConfigurations(); var bounds = config[0].getBounds(); width[i] = bounds.getWidth(); height[i] = bounds.getHeight(); }
Now you can use width[0] , width[1] and so on for Height to get the details.
If you want to get the monitor settings that the mouse cursor points to:
var screen, config,width, height; screen = java.awt.MouseInfo.getPointerInfo().getDevice(); config = screen.getConfigurations(); width = config[0].getBounds().getWidth(); height = config[0].getBounds().getHeight();
Pikesh prasoon
source share