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

Damon Nguyen dnguyen at openjdk.org
Wed Mar 22 19:28:48 UTC 2023


On Wed, 8 Mar 2023 06:43:42 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> https://github.com/openjdk/jdk/blob/21a6ab1e3ea5228a31955d58fe75e5ae66d1c6cd/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java#L552-L560
> 
> You took care of `enabled `property..If the above snippet still hold significance, do we need to do the same for `orientation `property too

I tested without any additional listener for orientation and set the combo's orientation to right_to_left. It's working correctly. So, I tested the code block you referenced above and removed the code for updating orientation when `comboBox != null`. This still works correctly. So, this portion of the code that updates the orientation in SynthComboBoxRenderer may be redundant.

However, the enabled portion seems to be needed, and the additional listener added is needed to generate the correct text color.

Nimbus test with a normal comboBox and a custom comboBox (with DefaultListCellRenderer) set with orientation RTL:
<img width="435" alt="Screen Shot 2023-03-22 at 9 44 25 AM" src="https://user-images.githubusercontent.com/96267980/227014415-3920c785-e2ea-45ba-b828-39e20a0d1d4d.png">


Test with a disabled, normal comboBox and custom comboBox (with DefaultListCellRenderer) set with orientation RTL:
<img width="432" alt="Screen Shot 2023-03-22 at 10 00 23 AM" src="https://user-images.githubusercontent.com/96267980/227014447-3a3f0aa0-377c-4f6b-9448-100d167652f7.png">

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

PR Comment: https://git.openjdk.org/jdk/pull/12390#issuecomment-1480136066



More information about the client-libs-dev mailing list