RFR: 6463708: DefaultButtonModel.setMnemonic generates ChangeEvent for no change
Prasanta Sadhukhan
psadhukhan at openjdk.org
Mon Jul 18 09:15:44 UTC 2022
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
-------------
Commit messages:
- Fix
- 6463708: DefaultButtonModel.setMnemonic generates ChangeEvent for no change
- 6463708: DefaultButtonModel.setMnemonic generates ChangeEvent for no change
Changes: https://git.openjdk.org/jdk/pull/9536/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9536&range=00
Issue: https://bugs.openjdk.org/browse/JDK-6463708
Stats: 64 lines in 2 files changed: 62 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/9536.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9536/head:pull/9536
PR: https://git.openjdk.org/jdk/pull/9536
More information about the client-libs-dev
mailing list