boolean () { boolean updated = false; GraphicsDevice[] devices = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); while (devices.length > myScreenList.size()) { myScreenList.add(new ScreenInfo()); updated = true; } while (devices.length < myScreenList.size()) { myScreenList.remove(devices.length); updated = true; } for (int i = 0; i < devices.length; i++) { if (myScreenList.get(i).update(devices[i].getDefaultConfiguration())) { updated = true; } } if (updated) { int minX = 0; int maxX = 0; int minY = 0; int maxY = 0; for (ScreenInfo info : myScreenList) { int x = info.myOuterBounds.x; if (minX > x) { minX = x; } x += info.myOuterBounds.width; if (maxX < x) { maxX = x; } int y = info.myOuterBounds.y; if (minY > y) { minY = y; } y += info.myOuterBounds.height; if (maxY < y) { maxY = y; } } myBounds.setBounds(minX, minY, maxX - minX, maxY - minY); } return updated; }