コード例 #1
0
 // test BUTTON1, 2 and 3 without any modifiers keys
 public static void testPlainButtons() {
   System.out.println("Testing buttons without modifiers.");
   f.addMouseListener(adapterTest1);
   for (int button : mouseButtons) {
     robot.mousePress(button);
     robot.delay(100);
     robot.mouseRelease(button);
   }
   robot.delay(1000);
   f.removeMouseListener(adapterTest1);
 }
コード例 #2
0
 // test BUTTON1, 2 and 3 with ALT key
 public static void testButtonsWithAlt() {
   System.out.println("Testing buttons with ALT modifier.");
   f.addMouseListener(adapterTest4);
   for (int button : mouseButtons) {
     robot.keyPress(KeyEvent.VK_ALT);
     robot.mousePress(button);
     robot.delay(100);
     robot.mouseRelease(button);
     robot.keyRelease(KeyEvent.VK_ALT);
   }
   robot.delay(1000);
   f.removeMouseListener(adapterTest4);
 }