RFR: 7093691: Nimbus LAF: disabled JComboBox using renderer has bad font color [v4]
Damon Nguyen
dnguyen at openjdk.org
Tue Feb 7 17:05:44 UTC 2023
On Tue, 7 Feb 2023 08:15:58 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> https://github.com/openjdk/jdk/blob/98433a2f6e7fe97e03ed26673c9925d7b26466bf/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java#L552-L558
>
> The present code SynthComboBoxRenderer does enable/disable the listcell renderer based on comboBox status, why it is not working? why do we need to use a listener for DefaultListCellRenderer?
>
> Also, I think it will be better to make the test automated..something like draw comboBox content into BufferedImage and pixel compare if it is same for disabled/enabled and fail if they are same and iterate for all L&Fs as it will also affect GTK as per the comment
The setEnabled line you mentioned in SynthComboBoxUI applies to SynthComboBoxRenderer only. This issue only occurs when DefaultListCellRenderer is used for a disabled Nimbus ComboBox instead of the default renderer for Nimbus (SynthComboBoxRenderer). So this code is never reached.
I will work on making the test automated instead if preferred.
-------------
PR: https://git.openjdk.org/jdk/pull/12390
More information about the client-libs-dev
mailing list