// some additional space, if getScreenInsets() does not work, say on Linux privatestaticfinalint SAFE = 100; privatestaticfinalint HEIGHT = 350; privatestaticfinalint WIDTH = 279; privatestatic Robot robot;
publicstaticvoid main(final String[] args) throws Exception {
robot = new Robot();
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] sds = ge.getScreenDevices();
for (GraphicsDevice sd : sds) {
GraphicsConfiguration gc = sd.getDefaultConfiguration();
Rectangle bounds = gc.getBounds();
bounds.translate(SAFE, SAFE);
Point point = new Point(bounds.x, bounds.y);
Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc); while (point.y < bounds.y + bounds.height - insets.bottom - HEIGHT - SAFE * 2) { while (point.x < bounds.x + bounds.width - insets.right - WIDTH - SAFE * 2) {
test(point, new Frame());
test(point, new Window(null));
test(point, new Dialog((Dialog) null));
point.translate(bounds.width / 6, 0);
}
point.setLocation(bounds.x, point.y + bounds.height / 5);
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.