Screen resolution of extended display

application.getScreenHeight() & application.getScreenWidth() return the resolution of the primary display.

In a two-monitor setup, is there a trick to programmatically determine:

  1. the resolution (screen width & height) of the extended display?
  2. if an extended display is connected?

(all this is for SmartClient only) In case the system uses virtual coordinates, the following code will print to console the virtual values for screen bounds - and it should also work with moving/auto restoring saved bounds for windows on other screens in Servoy. (some configuration bounds will not start at 0, 0 in this case - when using multiple screens)

var ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
var gs = ge.getScreenDevices();
var j;
for (j = 0; j < gs.length; j++) { 
     var gd = gs[j];
     application.output("Default configuration with bounds: " + gd.getDefaultConfiguration().getBounds() + " found for screen '" + gd.getIDstring() + "'.");

     // OR, if you want to see all capabilities of a screen
     //var gc = gd.getConfigurations();
     //var i;
     //for (i=0; i < gc.length; i++) {
     //    application.output("Configuration with bounds: " + gc[i].getBounds() + " found for device '" + gd.getIDstring() + "'.");
     //}
}

I guess a plugin would be useful in this area.

Thanks a million Andrei. I had given hope that there was a way…