privatestaticvoid showTestUI() {
frame = new JFrame();
frame.setBackground(Color.green);
JPanel p = new JPanel();
p.setBackground(Color.red);
JLabel l = new JLabel("Test!");
p.add(l);
frame.add(p);
frame.pack();
frame.setLocation(100,100);
frame.setVisible(true);
}
publicstaticvoid main(String[] args) throws Exception
{
Robot r = new Robot(); for (int i = 0; i < REPEATS; i++) { try {
SwingUtilities.invokeAndWait(bug8024864::showTestUI); //Thread.sleep(100);
Util.waitTillShown(frame);
Util.waitForIdle(r);
Dimension frameSize = frame.getSize();
Point loc = new Point(frameSize.width - 15, frameSize.height - 15);
SwingUtilities.convertPointToScreen(loc, frame);
Color c = r.getPixelColor(loc.x, loc.y);
if (c.getGreen() > 200) { thrownew RuntimeException("TEST FAILED. Unexpected pixel color " + c);
}
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.