< prev index next >

test/javax/swing/Action/8133039/bug8133039.java

Print this page
rev 14989 : 8160974: [TESTBUG] Mark more headful tests with @key headful.


  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.Robot;
  25 import java.awt.event.ActionEvent;
  26 import java.awt.event.KeyEvent;
  27 import javax.swing.AbstractAction;
  28 import javax.swing.Action;
  29 import javax.swing.JComboBox;
  30 import javax.swing.JFrame;
  31 import javax.swing.JLabel;
  32 import javax.swing.KeyStroke;
  33 import javax.swing.SwingUtilities;
  34 import sun.swing.UIAction;
  35 
  36 /**
  37  * @test

  38  * @bug 8133039
  39  * @summary Provide public API to sun.swing.UIAction#isEnabled(Object)
  40  * @modules java.desktop/sun.swing
  41  * @author Alexander Scherbatiy
  42  */
  43 public class bug8133039 {
  44 
  45     private static volatile int ACTION_PERFORMED_CALLS = 0;
  46     private static volatile int ACTION_ACCEPTED_CALLS = 0;
  47 
  48     public static void main(String[] args) throws Exception {
  49         testActionNotification();
  50         testPopupAction();
  51     }
  52 
  53     private static void testActionNotification() {
  54 
  55         KeyEvent keyEvent = new KeyEvent(new JLabel("Test"), 0, 0, 0, 0, 'A');
  56         SenderObject rejectedSenderObject = new SenderObject();
  57         SwingUtilities.notifyAction(new TestAction(false), null, keyEvent,




  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.Robot;
  25 import java.awt.event.ActionEvent;
  26 import java.awt.event.KeyEvent;
  27 import javax.swing.AbstractAction;
  28 import javax.swing.Action;
  29 import javax.swing.JComboBox;
  30 import javax.swing.JFrame;
  31 import javax.swing.JLabel;
  32 import javax.swing.KeyStroke;
  33 import javax.swing.SwingUtilities;
  34 import sun.swing.UIAction;
  35 
  36 /**
  37  * @test
  38  * @key headful
  39  * @bug 8133039
  40  * @summary Provide public API to sun.swing.UIAction#isEnabled(Object)
  41  * @modules java.desktop/sun.swing
  42  * @author Alexander Scherbatiy
  43  */
  44 public class bug8133039 {
  45 
  46     private static volatile int ACTION_PERFORMED_CALLS = 0;
  47     private static volatile int ACTION_ACCEPTED_CALLS = 0;
  48 
  49     public static void main(String[] args) throws Exception {
  50         testActionNotification();
  51         testPopupAction();
  52     }
  53 
  54     private static void testActionNotification() {
  55 
  56         KeyEvent keyEvent = new KeyEvent(new JLabel("Test"), 0, 0, 0, 0, 'A');
  57         SenderObject rejectedSenderObject = new SenderObject();
  58         SwingUtilities.notifyAction(new TestAction(false), null, keyEvent,


< prev index next >