test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java

Print this page

        

*** 33,47 **** import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ActionListenerCalledTwiceTest { ! static String menuItems[] = { "Item1", "Item2", "Item3" }; static KeyStroke keyStrokes[] = { KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK), KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK), }; static volatile int listenerCallCounter = 0; public static void main(String[] args) throws Exception { if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) { --- 33,48 ---- import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ActionListenerCalledTwiceTest { ! static String menuItems[] = { "Item1", "Item2", "Item3", "Item4" }; static KeyStroke keyStrokes[] = { KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK), KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK), + KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.META_MASK) }; static volatile int listenerCallCounter = 0; public static void main(String[] args) throws Exception { if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) {