< prev index next >

test/jdk/java/awt/TrayIcon/DblClickActionEventTest/DblClickActionEventTest.java

Print this page
rev 51542 : 8210039: move OSInfo to top level testlibrary
Reviewed-by: duke


  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25   test
  26   @bug 6284070
  27   @summary Tests that ActionEvent is generated when a tray icon is double-clicked
  28   @library ../../regtesthelpers
  29   @build Sysout
  30   @author artem.ananiev: area=awt.tray
  31   @run applet/manual=yesno DblClickActionEventTest.html
  32 */
  33 
  34 import java.applet.*;
  35 
  36 import java.awt.*;
  37 import java.awt.event.*;
  38 import java.awt.image.*;
  39 
  40 import jdk.testlibrary.OSInfo;
  41 import test.java.awt.regtesthelpers.Sysout;
  42 
  43 public class DblClickActionEventTest extends Applet {
  44     boolean traySupported;
  45 
  46     public void init() {
  47         this.setLayout(new BorderLayout());
  48 
  49         String[] instructions;
  50         traySupported = SystemTray.isSupported();
  51         if (traySupported) {
  52             String clickInstruction;
  53             if (OSInfo.getOSType().equals(OSInfo.OSType.MACOSX)) {
  54                 clickInstruction = "right";
  55             } else {
  56                 clickInstruction = "left";
  57             }
  58             instructions = new String[]{
  59                     "When the test starts an icon is added to the SystemTray area.",
  60                     " Double-click on it with a " + clickInstruction + " button and make sure that",
  61                     "  ACTION_PERFORMED event is sent to Java (all the clicks and",
  62                     "  action events are shown below these instructions).",
  63                     "Then, if your system allows the tray icon to get focus (for",
  64                     "  example, windows 2000 or windows XP), double-click on the",
  65                     "  icon with SPACE button and single-click with RETURN button.",
  66                     "  Both of them must also trigger ACTION_PERFORMED event.",
  67                     "If you see ACTION_PERFORMED events after each of your actions",
  68                     "  (either mouse clicks or key presses), press PASS, else FAIL"
  69             };
  70         } else {
  71             instructions = new String[]{
  72                     "The test cannot be run because SystemTray is not supported.",
  73                     "Simply press PASS button."




  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25   test
  26   @bug 6284070
  27   @summary Tests that ActionEvent is generated when a tray icon is double-clicked
  28   @library ../../regtesthelpers
  29   @build Sysout
  30   @author artem.ananiev: area=awt.tray
  31   @run applet/manual=yesno DblClickActionEventTest.html
  32 */
  33 
  34 import java.applet.*;
  35 
  36 import java.awt.*;
  37 import java.awt.event.*;
  38 import java.awt.image.*;
  39 
  40 import jdk.test.lib.Platform;
  41 import test.java.awt.regtesthelpers.Sysout;
  42 
  43 public class DblClickActionEventTest extends Applet {
  44     boolean traySupported;
  45 
  46     public void init() {
  47         this.setLayout(new BorderLayout());
  48 
  49         String[] instructions;
  50         traySupported = SystemTray.isSupported();
  51         if (traySupported) {
  52             String clickInstruction;
  53             if (Platform.isOSX()) {
  54                 clickInstruction = "right";
  55             } else {
  56                 clickInstruction = "left";
  57             }
  58             instructions = new String[]{
  59                     "When the test starts an icon is added to the SystemTray area.",
  60                     " Double-click on it with a " + clickInstruction + " button and make sure that",
  61                     "  ACTION_PERFORMED event is sent to Java (all the clicks and",
  62                     "  action events are shown below these instructions).",
  63                     "Then, if your system allows the tray icon to get focus (for",
  64                     "  example, windows 2000 or windows XP), double-click on the",
  65                     "  icon with SPACE button and single-click with RETURN button.",
  66                     "  Both of them must also trigger ACTION_PERFORMED event.",
  67                     "If you see ACTION_PERFORMED events after each of your actions",
  68                     "  (either mouse clicks or key presses), press PASS, else FAIL"
  69             };
  70         } else {
  71             instructions = new String[]{
  72                     "The test cannot be run because SystemTray is not supported.",
  73                     "Simply press PASS button."


< prev index next >