RFR: 7093691: Nimbus LAF: disabled JComboBox using renderer has bad font color [v5]

Damon Nguyen dnguyen at openjdk.org
Thu Feb 9 01:07:46 UTC 2023


On Wed, 8 Feb 2023 06:32:05 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> `SynthComboBoxUI.createRenderer` points to `SynthComboBoxRenderer `so I think `DefaultListCellRenderer `should not come into picture for rendering cells in the list which should go via `getListCellRendererComponent`. If it is playing a part, then how it works in other L&F which also has it own renderer (for example, `BasicComboBoxUI.createRenderer` points to `BasicComboBoxRenderer`, AquaComboBox points to `AquaComboBoxRenderer`) and they dont have this listener to make it work, so the question why do we need a listener for Synth still not clear to me..

I thought the same, but Nimbus seems to act different for this instance only. I traced the conditional in SynthComboBoxRenderer, and this was added in Apr 25, 2009 [here](https://github.com/openjdk/jdk/commit/c738ebdc6789068c3faf9e656bd4c02f84fe82bc#diff-54280d4d928e7579aa04324bb7d0a306f621b92d77d0dc508d8a269c124664a8). This seems like the introduction of Nimbus and how it's enabled/disabled ComboBoxes for Nimbus, with the oversight of setting a different renderer. This looks like the only OS that does this like you mentioned. The reason why this need to setEnabled in the renderer for Nimbus wasn't stated in the comment or bug description page. But it does seem to still need it as this was the only fix I found.

-------------

PR: https://git.openjdk.org/jdk/pull/12390



More information about the client-libs-dev mailing list