27
27
* @bug 6385277
28
28
* @summary Tests that override redirect window gets activated on click.
29
29
* @author anton.tarasov@sun.com: area=awt.focus
30
- * @library ../../regtesthelpers
31
- * @build Util
32
30
* @run main SimpleWindowActivationTest
33
31
*/
34
- import java .awt .*;
35
- import java .awt .event .*;
36
- import java .util .concurrent .Callable ;
37
- import javax .swing .SwingUtilities ;
38
- import test .java .awt .regtesthelpers .Util ;
32
+
33
+ import java .awt .AWTEvent ;
34
+ import java .awt .Button ;
35
+ import java .awt .Component ;
36
+ import java .awt .Dimension ;
37
+ import java .awt .FlowLayout ;
38
+ import java .awt .Frame ;
39
+ import java .awt .Label ;
40
+ import java .awt .Point ;
41
+ import java .awt .Robot ;
42
+ import java .awt .Toolkit ;
43
+ import java .awt .Window ;
44
+ import java .awt .event .AWTEventListener ;
45
+ import java .awt .event .FocusEvent ;
46
+ import java .awt .event .InputEvent ;
47
+ import java .awt .event .WindowEvent ;
39
48
40
49
public class SimpleWindowActivationTest {
41
50
@@ -59,9 +68,11 @@ public void eventDispatched(AWTEvent e) {
59
68
60
69
createAndShowWindow ();
61
70
robot .waitForIdle ();
71
+ robot .delay (500 );
62
72
63
73
createAndShowFrame ();
64
74
robot .waitForIdle ();
75
+ robot .delay (500 );
65
76
66
77
// click on Frame
67
78
clickOn (getClickPoint (frame ));
@@ -130,8 +141,8 @@ static void clickOn(Point point) {
130
141
robot .mouseMove (point .x , point .y );
131
142
robot .waitForIdle ();
132
143
133
- robot .mousePress (InputEvent .BUTTON1_MASK );
134
- robot .mouseRelease (InputEvent .BUTTON1_MASK );
144
+ robot .mousePress (InputEvent .BUTTON1_DOWN_MASK );
145
+ robot .mouseRelease (InputEvent .BUTTON1_DOWN_MASK );
135
146
136
147
robot .waitForIdle ();
137
148
}
0 commit comments