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

Print this page

        

@@ -520,19 +520,21 @@
             comboBox.setPopupVisible(true);
         }
     };
 
     @SuppressWarnings("serial") // anonymous class
-    private static Action hideAction = new AbstractAction() {
+    private final 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);
             }
+
+        @Override
+        public boolean isEnabled() {
+            return comboBox.isPopupVisible() && super.isEnabled();
         }
     };
 
     public void applySizeFor(final JComponent c, final Size size) {
         if (arrowButton == null) return;