Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6382373

The spec should be more verbose about behaviour of ActionListener of JComboBox

XMLWordPrintable

      "public void setSelectedItem(java.lang.Object anObject)
      ...
      If anObject is not in the list and the combo box is uneditable, it will not change the current selection.
       ...
       ActionListeners added to the combo box will be notified with an ActionEvent when this method is called."

      "public void addActionListener(ActionListener l)
      ...
      The ActionListener will receive an ActionEvent when a selection has been made.
      "

      So it's not clear should an ActionEvent be fired when selection has not been made as in the case of anObject is not in the list. And should an event be fired when a deselection has been made?

            Unassigned Unassigned
            alalexee Alexander Alexeev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: