RFR: 6463708: DefaultButtonModel.setMnemonic generates ChangeEvent for no change
Alexander Zvegintsev
azvegint at openjdk.org
Mon Jul 18 14:53:02 UTC 2022
On Mon, 18 Jul 2022 08:42:06 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> For a DefaultButtonModel, setMnemonic() generates a ChangeEvent even if the new value is the same as the old value (that is, even if nothing has changed).
> Fix is to fire StateChange event only if the value has changed.
>
> This is consistent with other places like
> https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/colorchooser/DefaultColorSelectionModel.java#L103
> https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/DefaultSingleSelectionModel.java#L79
> https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/DefaultBoundedRangeModel.java#L309
Marked as reviewed by azvegint (Reviewer).
-------------
PR: https://git.openjdk.org/jdk/pull/9536
More information about the client-libs-dev
mailing list