--- old/test/javax/swing/Popup/TaskbarPositionTest.java 2016-12-16 21:59:22.000000000 +0300 +++ new/test/javax/swing/Popup/TaskbarPositionTest.java 2016-12-16 21:59:21.000000000 +0300 @@ -62,14 +62,14 @@ }; public TaskbarPositionTest() { - super("Use CTRL-down to show a JPopupMenu"); + super("Use down to show a JPopupMenu"); setContentPane(panel = createContentPane()); setJMenuBar(createMenuBar("1 - First Menu", true)); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - // CTRL-down will show the popup. + //Down will show the popup. panel.getInputMap().put(KeyStroke.getKeyStroke( - KeyEvent.VK_DOWN, InputEvent.CTRL_MASK), "OPEN_POPUP"); + KeyEvent.VK_DOWN, 0), "OPEN_POPUP"); panel.getActionMap().put("OPEN_POPUP", new PopupHandler()); pack(); @@ -112,9 +112,12 @@ if (pm != null) { Point p = pm.getLocation(); SwingUtilities.convertPointToScreen(p, pm); - if (p.y < cpos.y) { - throw new RuntimeException("ComboBox popup is wrongly aligned"); - } // check that popup was opened down + if (!UIManager.getLookAndFeel() + .getName().toLowerCase().contains("os x")) { + if (p.y < cpos.y) { + throw new RuntimeException("ComboBox popup is wrongly aligned"); + } // check that popup was opened down + } } } } @@ -186,10 +189,10 @@ } panel.addMouseListener(new PopupListener(popupMenu)); - JTextField field = new JTextField("CTRL+down for Popup"); - // CTRL-down will show the popup. + JTextField field = new JTextField("Press down for Popup"); + //Down will show the popup. field.getInputMap().put(KeyStroke.getKeyStroke( - KeyEvent.VK_DOWN, InputEvent.CTRL_MASK), "OPEN_POPUP"); + KeyEvent.VK_DOWN, 0), "OPEN_POPUP"); field.getActionMap().put("OPEN_POPUP", new PopupHandler()); panel.add(field); @@ -260,7 +263,6 @@ public static void main(String[] args) throws Throwable { - SwingUtilities.invokeAndWait(new Runnable() { public void run() { test = new TaskbarPositionTest(); @@ -296,7 +298,6 @@ robot.keyPress(KeyEvent.VK_DOWN); // How do we check combo boxes? - // Editable combo box robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); @@ -304,14 +305,11 @@ robot.keyRelease(KeyEvent.VK_DOWN); // combo1.getUI(); - // Popup from Text field robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); - robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_DOWN); robot.keyRelease(KeyEvent.VK_DOWN); - robot.keyRelease(KeyEvent.VK_CONTROL); // Popup from a mouse click. Point pt = new Point(2, 2); @@ -336,5 +334,15 @@ robot.waitForIdle(); Thread.sleep(500); + disposeGUI(); + } + + private static void disposeGUI() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + test.dispose(); + } + }); } } +