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

List triggers ItemEvent-ItemStateChanged when selecting an already selected item (single-sel mode)

XMLWordPrintable

    • generic
    • generic

      AWT List triggers an ItemEvent (ItemStateChanged) when selecting an item that already remains selected, in single selection mode. This behavior makes sense for multi-selection list since selecting the already selected item will de-select it. But in single-selection mode, nothing actually happens when selecting the already selected item and hence no item event must be triggered in this case. ItemEvent should be triggered only when there is a change in the selection.

      This is reproducible since 1.4 on Win32, Solaris, Linux. Reproducible on XToolkit.

      I have attached a sample test. Execute the sample test. Select an item from the list. Check whether ItemEvent is triggered. Select the same item again from the list. If you see another item event being triggered, the bug is reproduced.
      ###@###.### 2005-03-26 16:05:05 GMT

            dcherepanov Dmitry Cherepanov
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: