39
39
* @bug 6299866 8316931
40
40
* @summary Tests that no NPE is thrown when the tray icon is disposed from the
41
41
* handler of action event caused by clicking on this icon.
42
- * @library ../.. /regtesthelpers /test/lib
42
+ * @library /java/awt /regtesthelpers /test/lib
43
43
* @build PassFailJFrame jtreg.SkippedException
44
44
* @run main/manual DisposeInActionEventTest
45
45
*/
46
46
47
47
public class DisposeInActionEventTest {
48
- private static JTextArea textArea ;
49
48
private static SystemTray systemTray ;
50
49
private static TrayIcon trayIcon ;
51
50
@@ -57,24 +56,26 @@ public static void main(String[] args) throws Exception {
57
56
String clickInstruction =
58
57
(Platform .isOSX ()) ? "Right-click" : "Double click (left mouse button)" ;
59
58
60
- String instructions = "When the test starts, it adds the icon to the tray area. If you\n " +
61
- " don't see a tray icon, please, make sure that the tray area\n " +
62
- " (also called Taskbar Status Area on MS Windows, Notification\n " +
63
- " Area on Gnome or System Tray on KDE) is visible.\n \n " +
64
- clickInstruction + " the tray icon to trigger the\n " +
65
- " action event. Brief information about action events is printed\n " +
66
- " in the frame. After each action event, the tray icon is removed from\n " +
67
- " the tray and then added back in a second.\n \n " +
59
+ String instructions = "When the test starts, it adds an icon to the tray area.\n " +
60
+ "The icon is a red filled square with a white border.\n " +
61
+ "If you don't see this tray icon, please make sure that the tray area\n " +
62
+ "(also called Taskbar Status Area on MS Windows, Notification\n " +
63
+ "Area on Gnome or System Tray on KDE) is visible.\n " +
64
+ "On macOS the default location is the right of the top system bar.\n \n " +
65
+ clickInstruction + " the tray icon to trigger the action event.\n " +
66
+ "Brief information about action events is printed\n " +
67
+ "in the Event Message Display frame.\n " +
68
+ "After each action event, the tray icon is removed from\n " +
69
+ "the tray and then added back in a second.\n \n " +
68
70
"The test checks if any exceptions are thrown when removing and\n " +
69
- " re-adding the icon. If something is wrong, the test will automatically fail.\n " +
70
- " Repeat clicks several times Then press PASS button." ;
71
+ "re-adding the icon. If something is wrong, the test will automatically fail.\n " +
72
+ "Repeat clicks several times. Then press PASS button." ;
71
73
72
74
try {
73
75
PassFailJFrame .builder ()
74
76
.title ("DisposeInActionEventTest" )
75
77
.instructions (instructions )
76
- .testTimeOut (10 )
77
- .rows (15 )
78
+ .rows (18 )
78
79
.columns (45 )
79
80
.testUI (DisposeInActionEventTest ::showFrameAndIcon )
80
81
.build ()
@@ -90,7 +91,7 @@ private static JFrame showFrameAndIcon() {
90
91
JFrame frame = new JFrame ("Event Message Display" );
91
92
frame .setLayout (new BorderLayout ());
92
93
93
- textArea = new JTextArea ();
94
+ JTextArea textArea = new JTextArea ();
94
95
frame .getContentPane ().add (new JScrollPane (textArea ));
95
96
frame .setSize (400 , 200 );
96
97
0 commit comments