JDK-4190102 : ButtonGroup deselection problem?
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1.6,1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,windows_nt
  • CPU: generic,x86
  • Submitted: 1998-11-16
  • Updated: 2001-11-14
  • Resolved: 2001-11-14
Related Reports
Duplicate :  
Description

Name: clC74495			Date: 11/16/98


With the setSelected() method of ButtonGroup, I can pass a ButtonModel
not in the ButtonGroup to the method.
 This results in nothing selected
for the group.
  I can also pass null as the model, which results in the same
thing.

According to the javadoc documentation:
"Once any button is selected, one button is always selected in the group.
There is no way to turn a button programmatically to "off", in order to
clear the button group. "
 This behavior seems in error.

Can one legitimately pass a model not in the group (or null) to clear the
selection?
(Review ID: 42768)
======================================================================

Comments
EVALUATION This is technically a bug. However, we've heard from many people who rely on this as a feature, so I'm very hesitant to fix it. What we really need, of course, is a clearSelection method. jeff.dinkins@Eng 1999-09-19 Name: keR10081 Date: 08/28/2001 I suggest to keep the current functionality and change the doc saying that setSelected(null) clears the selection. ###@###.### ====================================================================== It looks like this feature/bug of setSelected(null, true) working to clear the selection has dissapeared in 1.4. However, setSelected with a ButtonModel not a member of the group still seems to clear the selection. This is a side-effect of the current implementation and it should not be relied on. RFE 4066394 addresses the problems of clearing the selection in a ButtonGroup. ###@###.### 2001-11-13
13-11-2001