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

REGRESSION: ButtonGroup does not initially enforce semaphore/XOR

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • client-libs



      Name: ddT132432 Date: 10/24/2001


      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)

      If two separate AbstractButton objects are both selected,
      and both are added to the same ButtonGroup object, they will
      both continue to be selected after the addition to the group.
      The ButtonGroup class currently checks for selectedness in
      the add(AbstractButton) method, so I'm assuming the problem
      is in the ButtonModel.setGroup(ButtonGroup) method.

        Here is some trivial code to demonstrate:

      JRadioButton buttonOne = new JRadioButton("one", true);
      JRadioButton buttonTwo = new JRadioButton("two", true);
      ButtonGroup group = new ButtonGroup();
      group.add(buttonOne);
      group.add(buttonTwo);
      // Both buttons are selected at this point

        The old behavior in 1.3 seemed to be to retain the first
      button that is selected as the selected button when others
      are added.

      Release Regression From : merlin-beta3
      The above release value was the last known release where this
      bug was knwon to work. Since then there has been a regression.

      (Review ID: 134395)
      ======================================================================

            shickeysunw Shannon Hickey (Inactive)
            ddressersunw Daniel Dresser (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: