JDK-5045434 : JList.setSelectedIndex(-1) should clear the selection
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0,1.4.2
  • Priority: P5
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic,windows_2000
  • CPU: generic,x86
  • Submitted: 2004-05-11
  • Updated: 2019-12-17
  • Resolved: 2019-12-17
Related Reports
Relates :  
Description
Name: jl125535			Date: 05/11/2004


A DESCRIPTION OF THE REQUEST :
JList.setSelectedIndex(-1) should clear the selection

JUSTIFICATION :
On a JList, calling getSelectedIndex() when nothing is selected return -1.
However, calling setSelectedIndex(-1) does not unselect all element in the list.

This is inconsistent behaviour and should be corrected.

CUSTOMER SUBMITTED WORKAROUND :
In fact the normal way to unselect all element of a list is list.clearSelection();
(Incident Review ID: 237576) 
======================================================================