src/macosx/classes/com/apple/laf/AquaComboBoxUI.java

Print this page

        

*** 520,538 **** comboBox.setPopupVisible(true); } }; @SuppressWarnings("serial") // anonymous class ! private static Action hideAction = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { final JComboBox comboBox = (JComboBox)e.getSource(); - - if (comboBox.isPopupVisible()) { comboBox.firePopupMenuCanceled(); comboBox.setPopupVisible(false); } } }; public void applySizeFor(final JComponent c, final Size size) { if (arrowButton == null) return; --- 520,540 ---- comboBox.setPopupVisible(true); } }; @SuppressWarnings("serial") // anonymous class ! private final Action hideAction = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { final JComboBox comboBox = (JComboBox)e.getSource(); comboBox.firePopupMenuCanceled(); comboBox.setPopupVisible(false); } + + @Override + public boolean isEnabled() { + return comboBox.isPopupVisible() && super.isEnabled(); } }; public void applySizeFor(final JComponent c, final Size size) { if (arrowButton == null) return;