This bug is filed in response to:
4680670 : Adjustable.setValue() does not notify AdjustmentListener
The short answer to this can be found in "The Java Class Libraries Second Edition, Volume 2" in the setValue() documentation for Scrollbar:
"Calling setValue() does not fire an AdjustmentEvent."
For some reason, though, this passage does not appear in the JavaDoc for java.awt.Scrollbar, resulting in the following:
4195694 : Scrollbar.set{Value,Values()} fails to generate an AdjustmentEvent
4193532 : Java v1.1.6 Scrollbar generates recursive event loop
4040860 : AdjustmentEvent not delivered when scrollbar's value is changed programmatically (1997!)
4680670 : Adjustable.setValue() does not notify AdjustmentListener
We went through a similar stream of bugs with Checkbox and List:
4324396 : AWT Checkbox and CheckboxMenuItem's setState() will not trigger an ItemEvent
4067113 : ItemListener not fired when using methods to select/deselect
4034837 : Checkbox.setState() does not notify listeners
4032466 : item events not generated when state programmaticaly set on Checkbox/List
with the final resolution:
4318851 : ItemEvent not triggered List,Choice,CheckBox,CheckboxMenuItem
which has a fairly robust description of the situation for ItemEvents.
The same goes for Scrollbar and AdjustmentEvents, and any Component which sends state change events when a user interacts with it, but can also have its state modified programmatically. Programmatic state changes do not trigger events. This message needs to be in all applicable Components, and hopefully that will prevent future misunderstandings and bugs from being filed.
4680670 : Adjustable.setValue() does not notify AdjustmentListener
The short answer to this can be found in "The Java Class Libraries Second Edition, Volume 2" in the setValue() documentation for Scrollbar:
"Calling setValue() does not fire an AdjustmentEvent."
For some reason, though, this passage does not appear in the JavaDoc for java.awt.Scrollbar, resulting in the following:
4195694 : Scrollbar.set{Value,Values()} fails to generate an AdjustmentEvent
4193532 : Java v1.1.6 Scrollbar generates recursive event loop
4040860 : AdjustmentEvent not delivered when scrollbar's value is changed programmatically (1997!)
4680670 : Adjustable.setValue() does not notify AdjustmentListener
We went through a similar stream of bugs with Checkbox and List:
4324396 : AWT Checkbox and CheckboxMenuItem's setState() will not trigger an ItemEvent
4067113 : ItemListener not fired when using methods to select/deselect
4034837 : Checkbox.setState() does not notify listeners
4032466 : item events not generated when state programmaticaly set on Checkbox/List
with the final resolution:
4318851 : ItemEvent not triggered List,Choice,CheckBox,CheckboxMenuItem
which has a fairly robust description of the situation for ItemEvents.
The same goes for Scrollbar and AdjustmentEvents, and any Component which sends state change events when a user interacts with it, but can also have its state modified programmatically. Programmatic state changes do not trigger events. This message needs to be in all applicable Components, and hopefully that will prevent future misunderstandings and bugs from being filed.
- relates to
-
JDK-4318851 ItemEvent not triggered List,Choice,CheckBox,CheckboxMenuItem
-
- Closed
-
-
JDK-4680670 Adjustable.setValue() does not notify AdjustmentListener
-
- Closed
-