java/awt/Focus/ChildWindowFocusTest/ChildWindowFocusTest.java
Print this page
@@ -39,34 +39,30 @@
Rectangle bounds = Sysout.dialog.getBounds();
shift = (int)(bounds.x + bounds.width + 10);
}
public void start() {
- if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
- System.out.println("No testing on Motif! Passed.");
- return;
- }
- frame.setBounds(0, 0, 400, 100);
+ frame.setBounds(0, 50, 400, 100);
frame.setLayout(new FlowLayout());
frame.add(button0);
- outerFrame.setBounds(0, 340, 400, 100);
+ outerFrame.setBounds(0, 390, 400, 100);
outerFrame.setLayout(new FlowLayout());
outerFrame.add(button1);
adjustAndShow(new Component[] {frame, win1, win2, outerFrame});
- waitForIdle();
+ robot.waitForIdle();
test();
}
void adjustAndShow(Component[] comps) {
for (Component comp: comps) {
comp.setLocation(shift, (int)comp.getLocation().getY());
comp.setVisible(true);
- waitForIdle();
+ robot.waitForIdle();
}
}
void test() {
clickOnCheckFocusOwner(button0);
@@ -106,16 +102,13 @@
}
robot.delay(50);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.delay(50);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
- waitForIdle();
+ robot.waitForIdle();
}
- void waitForIdle() {
- ((sun.awt.SunToolkit) Toolkit.getDefaultToolkit()).realSync();
- }
}
class TestWindow extends Window {
TestWindow(Window owner, Component comp, int x) {
super(owner);