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

CTRL-Click in JComboBox allows null (item -1) to become selected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • beta2
    • generic
    • generic

      Compile and run the attached app.

      Try selecting an item in the JComboBox. Notice that the index of the item selected is printed on the console.

      Now, holding down the CTRL key, click and open the JComboBox and select an item. Notice that the index printed to the console is -1. Also notice that the JComboBox now shows no selected item.

      This is occuring because of how we use JList inside BasicComboPopup to represent the combo box items. JList allows item -1 to become selected. To see this, try CTRL clicking twice on the same item in the JList at the bottom of the app.

      JComboBox should not allow this JList behaviour to show.

            peterz Peter Zhelezniakov
            shickeysunw Shannon Hickey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: