File tree 1 file changed +15
-6
lines changed
test/jdk/javax/swing/JRadioButton/8033699
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2014, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2014, 2024 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
28
28
* @summary Incorrect radio button behavior when pressing tab key
29
29
* @run main bug8033699
30
30
*/
31
+
31
32
import java .awt .KeyboardFocusManager ;
32
33
import java .awt .Robot ;
33
34
import java .awt .event .ActionListener ;
@@ -57,42 +58,50 @@ public class bug8033699 {
57
58
58
59
public static void main (String [] args ) throws Throwable {
59
60
SwingUtilities .invokeAndWait (() -> {
60
- changeLAF ();
61
- createAndShowGUI ();
61
+ changeLAF ();
62
+ createAndShowGUI ();
62
63
});
63
64
64
65
robot = new Robot ();
65
- Thread .sleep (100 );
66
- robot .waitForIdle ();
67
-
68
66
robot .setAutoDelay (100 );
67
+ robot .waitForIdle ();
68
+ robot .delay (1000 );
69
69
70
70
// tab key test grouped radio button
71
71
runTest1 ();
72
+ robot .delay (100 );
72
73
73
74
// tab key test non-grouped radio button
74
75
runTest2 ();
76
+ robot .delay (100 );
75
77
76
78
// shift tab key test grouped and non-grouped radio button
77
79
runTest3 ();
80
+ robot .delay (100 );
78
81
79
82
// left/up key test in grouped radio button
80
83
runTest4 ();
84
+ robot .delay (100 );
81
85
82
86
// down/right key test in grouped radio button
83
87
runTest5 ();
88
+ robot .delay (100 );
84
89
85
90
// tab from radio button in group to next component in the middle of button group layout
86
91
runTest6 ();
92
+ robot .delay (100 );
87
93
88
94
// tab to radio button in group from component in the middle of button group layout
89
95
runTest7 ();
96
+ robot .delay (100 );
90
97
91
98
// down key circle back to first button in grouped radio button
92
99
runTest8 ();
100
+ robot .delay (100 );
93
101
94
102
// Verify that ActionListener is called when a RadioButton is selected using arrow key.
95
103
runTest9 ();
104
+ robot .delay (100 );
96
105
97
106
SwingUtilities .invokeAndWait (() -> mainFrame .dispose ());
98
107
}
You can’t perform that action at this time.
0 commit comments