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 import java.awt.*;
24 import java.awt.event.*;
25 import java.awt.image.BufferedImage;
26
27 /*
28 * @test
29 * @summary Check if a JPopupMenu can be displayed when TrayIcon is
30 * right clicked. It uses a JWindow as the parent of the JPopupMenu
31 * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
32 * @library /java/awt/patchlib
33 * @library ../../../../lib/testlibrary ../
34 * @build java.desktop/java.awt.Helper
35 * @build ExtendedRobot SystemTrayIconHelper
36 * @run main TrayIconPopupTest
37 */
38
39 public class TrayIconPopupTest {
40
41 TrayIcon icon;
42 ExtendedRobot robot;
43
44 boolean actionPerformed = false;
45 Object actionLock = new Object();
46 static final int ATTEMPTS = 50;
47
48 PopupMenu popup;
49 Dialog window;
50
51 public static void main(String[] args) throws Exception {
52 if (!SystemTray.isSupported()) {
53 System.out.println("SystemTray not supported on the platform under test. " +
|
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 import java.awt.*;
24 import java.awt.event.*;
25 import java.awt.image.BufferedImage;
26
27 /*
28 * @test
29 * @summary Check if a JPopupMenu can be displayed when TrayIcon is
30 * right clicked. It uses a JWindow as the parent of the JPopupMenu
31 * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
32 * @library /java/awt/patchlib
33 * @library ../../../../lib/testlibrary
34 * @build java.desktop/java.awt.Helper
35 * @build ExtendedRobot SystemTrayIconHelper
36 * @run main TrayIconPopupTest
37 */
38
39 public class TrayIconPopupTest {
40
41 TrayIcon icon;
42 ExtendedRobot robot;
43
44 boolean actionPerformed = false;
45 Object actionLock = new Object();
46 static final int ATTEMPTS = 50;
47
48 PopupMenu popup;
49 Dialog window;
50
51 public static void main(String[] args) throws Exception {
52 if (!SystemTray.isSupported()) {
53 System.out.println("SystemTray not supported on the platform under test. " +
|