File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
test/jdk/java/awt/event/KeyEvent Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,14 @@ public void middleOf(Component c, Point p) {
91
91
p .setLocation (loc .x + (size .width / 2 ), loc .y + (size .height / 2 ));
92
92
}
93
93
94
- public void performTest () throws AWTException {
94
+ public void performTest () throws AWTException , InterruptedException ,
95
+ InvocationTargetException {
95
96
Robot robot = new Robot ();
96
97
robot .setAutoDelay (50 );
97
98
robot .delay (500 );
98
99
robot .waitForIdle ();
99
100
Point target = new Point ();
100
- middleOf (lwbutton , target );
101
+ EventQueue . invokeAndWait (() -> middleOf (lwbutton , target ) );
101
102
robot .mouseMove (target .x , target .y );
102
103
robot .mousePress (InputEvent .BUTTON1_DOWN_MASK );
103
104
robot .mouseRelease (InputEvent .BUTTON1_DOWN_MASK );
@@ -111,7 +112,7 @@ public void performTest() throws AWTException {
111
112
robot .keyRelease (KeyEvent .VK_B );
112
113
robot .waitForIdle ();
113
114
robot .delay (500 );
114
- middleOf (hwbutton , target );
115
+ EventQueue . invokeAndWait (() -> middleOf (hwbutton , target ) );
115
116
robot .mouseMove (target .x , target .y );
116
117
robot .keyPress (KeyEvent .VK_C );
117
118
robot .keyRelease (KeyEvent .VK_C );
You can’t perform that action at this time.
0 commit comments