< prev index next >

test/jdk/java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java

Print this page




  23 import java.awt.TrayIcon;
  24 import java.awt.SystemTray;
  25 import java.awt.EventQueue;
  26 import java.awt.Point;
  27 import java.awt.AWTException;
  28 import java.awt.event.MouseEvent;
  29 import java.awt.event.ActionEvent;
  30 import java.awt.event.ActionListener;
  31 import java.awt.event.InputEvent;
  32 import java.awt.event.MouseAdapter;
  33 import java.awt.image.BufferedImage;
  34 
  35 /*
  36  * @test
  37  * @key headful
  38  * @summary Check if a action performed event is received when TrayIcon display
  39  *          message is clicked on.
  40  * @author Shashidhara Veerabhadraiah (shashidhara.veerabhadraiah@oracle.com)
  41  * @modules java.desktop/java.awt:open
  42  * @library /java/awt/patchlib
  43  * @library ../../../../lib/testlibrary ../
  44  * @build java.desktop/java.awt.Helper
  45  * @build ExtendedRobot SystemTrayIconHelper
  46  * @run main TrayIconPopupClickTest
  47  */
  48 
  49 public class TrayIconPopupClickTest {
  50 
  51     TrayIcon icon;
  52     ExtendedRobot robot;
  53     boolean actionPerformed = false;
  54 
  55     public static void main(String[] args) throws Exception {
  56         if (!SystemTray.isSupported()) {
  57             System.out.println("SystemTray not supported on the platform under test. " +
  58                     "Marking the test passed");
  59         } else {
  60             if (System.getProperty("os.name").toLowerCase().startsWith("win"))
  61                 System.err.println("Test can fail if the icon hides to a tray icons pool " +
  62                         "in Windows 7/10, which is behavior by default.\n" +
  63                         "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +




  23 import java.awt.TrayIcon;
  24 import java.awt.SystemTray;
  25 import java.awt.EventQueue;
  26 import java.awt.Point;
  27 import java.awt.AWTException;
  28 import java.awt.event.MouseEvent;
  29 import java.awt.event.ActionEvent;
  30 import java.awt.event.ActionListener;
  31 import java.awt.event.InputEvent;
  32 import java.awt.event.MouseAdapter;
  33 import java.awt.image.BufferedImage;
  34 
  35 /*
  36  * @test
  37  * @key headful
  38  * @summary Check if a action performed event is received when TrayIcon display
  39  *          message is clicked on.
  40  * @author Shashidhara Veerabhadraiah (shashidhara.veerabhadraiah@oracle.com)
  41  * @modules java.desktop/java.awt:open
  42  * @library /java/awt/patchlib
  43  * @library ../../../../lib/client ../
  44  * @build java.desktop/java.awt.Helper
  45  * @build ExtendedRobot SystemTrayIconHelper
  46  * @run main TrayIconPopupClickTest
  47  */
  48 
  49 public class TrayIconPopupClickTest {
  50 
  51     TrayIcon icon;
  52     ExtendedRobot robot;
  53     boolean actionPerformed = false;
  54 
  55     public static void main(String[] args) throws Exception {
  56         if (!SystemTray.isSupported()) {
  57             System.out.println("SystemTray not supported on the platform under test. " +
  58                     "Marking the test passed");
  59         } else {
  60             if (System.getProperty("os.name").toLowerCase().startsWith("win"))
  61                 System.err.println("Test can fail if the icon hides to a tray icons pool " +
  62                         "in Windows 7/10, which is behavior by default.\n" +
  63                         "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +


< prev index next >