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 import java.awt.EventQueue;
25 import java.awt.Point;
26 import java.awt.SystemTray;
27 import java.awt.TrayIcon;
28 import java.awt.event.InputEvent;
29 import java.awt.image.BufferedImage;
30
31 /*
32 * @test
33 * @bug 6384991
34 * @summary Check if ActionEvent is triggered by a TrayIcon when
35 * it is double clicked with mouse button 1 on windows
36 * or single clicked with button 3 on Mac OS X
37 * or single clicked with button 1 on rest.
38 * @modules java.desktop/java.awt:open
39 * @library /java/awt/patchlib
40 * @library ../../../../lib/testlibrary ../
41 * @build java.desktop/java.awt.Helper
42 * @build ExtendedRobot SystemTrayIconHelper
43 * @run main TrayIconMouseTest
44 */
45
46 public class TrayIconMouseTest {
47
48 TrayIcon icon;
49 ExtendedRobot robot;
50 boolean actionPerformed = false;
51 Object actionLock = new Object();
52 static boolean isMacOS = false;
53 static boolean isWinOS = false;
|
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 import java.awt.EventQueue;
25 import java.awt.Point;
26 import java.awt.SystemTray;
27 import java.awt.TrayIcon;
28 import java.awt.event.InputEvent;
29 import java.awt.image.BufferedImage;
30
31 /*
32 * @test
33 * @bug 6384991
34 * @key headful
35 * @summary Check if ActionEvent is triggered by a TrayIcon when
36 * it is double clicked with mouse button 1 on windows
37 * or single clicked with button 3 on Mac OS X
38 * or single clicked with button 1 on rest.
39 * @modules java.desktop/java.awt:open
40 * @library /java/awt/patchlib
41 * @library ../../../../lib/testlibrary ../
42 * @build java.desktop/java.awt.Helper
43 * @build ExtendedRobot SystemTrayIconHelper
44 * @run main TrayIconMouseTest
45 */
46
47 public class TrayIconMouseTest {
48
49 TrayIcon icon;
50 ExtendedRobot robot;
51 boolean actionPerformed = false;
52 Object actionLock = new Object();
53 static boolean isMacOS = false;
54 static boolean isWinOS = false;
|