1 /* 2 test 3 @bug 6384984 4 @summary TrayIcon try to dispay a tooltip when is not visible 5 @author Dmitry.Cherepanov@sun.com area=awt.tray 6 @run applet/manual=yesno ShowAfterDisposeTest.html 7 */ 8 9 import java.applet.*; 10 11 import java.awt.*; 12 import java.awt.event.*; 13 import java.awt.image.*; 14 15 public class ShowAfterDisposeTest extends Applet 16 { 17 boolean traySupported; 18 19 public void init() 20 { 21 this.setLayout (new BorderLayout ()); 22 23 String[] instructions; 24 traySupported = SystemTray.isSupported(); 25 if (traySupported) 26 { 27 String[] s = 28 { 29 "1) When the test starts an icon is added to the SystemTray area.", 30 "2) Double click on this icon (it's important to click before the tooltip is shown).", 31 "3) If the bug is reproducible then the test will fail without assistance.", 32 "4) Just press the 'pass' button." 33 }; 34 instructions = s; 35 } 36 else 37 { 38 String[] s = 39 { 40 "The test cannot be run because SystemTray is not supported.", 41 "Simply press PASS button." 42 }; 43 instructions = s; 44 } 45 Sysout.createDialogWithInstructions(instructions); 46 } 47 48 public void start () 49 { 50 setSize (200,200); | 1 /* 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 test 26 @bug 6384984 8004032 27 @summary TrayIcon try to dispay a tooltip when is not visible 28 @author Dmitry.Cherepanov@sun.com area=awt.tray 29 @run applet/manual=yesno ShowAfterDisposeTest.html 30 */ 31 32 import java.applet.*; 33 34 import java.awt.*; 35 import java.awt.event.*; 36 import java.awt.image.*; 37 38 public class ShowAfterDisposeTest extends Applet 39 { 40 boolean traySupported; 41 42 public void init() 43 { 44 this.setLayout (new BorderLayout ()); 45 46 String[] instructions; 47 traySupported = SystemTray.isSupported(); 48 if (traySupported) 49 { 50 String[] s = 51 { 52 "1) When the test starts an icon is added to the SystemTray area.", 53 "2a) If you use Apple OS X,", 54 " right click on this icon (it's important to click before the tooltip is shown).", 55 " The icon should disappear.", 56 "2b) If you use other os (Windows, Linux, Solaris),", 57 " double click on this icon (it's important to click before the tooltip is shown).", 58 " The icon should disappear.", 59 "3) If the bug is reproducible then the test will fail without assistance.", 60 "4) Just press the 'pass' button." 61 }; 62 instructions = s; 63 } 64 else 65 { 66 String[] s = 67 { 68 "The test cannot be run because SystemTray is not supported.", 69 "Simply press PASS button." 70 }; 71 instructions = s; 72 } 73 Sysout.createDialogWithInstructions(instructions); 74 } 75 76 public void start () 77 { 78 setSize (200,200); |