RFR: 8295006: Colored text is not shown on disabled checkbox and radiobutton with GTK LAF for bug4314194 [v2]
Sergey Bylokhov
serb at openjdk.org
Wed Oct 19 09:26:57 UTC 2022
On Wed, 19 Oct 2022 07:13:44 GMT, Abhishek Kumar <duke at openjdk.org> wrote:
>> Existing test `open/test/jdk/javax/swing/JRadioButton/4314194/bug4314194.java` was not showing colored text for disabled checkbox and radiobutton in GTK LAF.
>>
>> The fix is to get the disabled state color for checkbox and radiobutton from UIManager if it exists.
>>
>> Test case `open/test/jdk/javax/swing/JRadioButton/4314194/bug4314194.java` has been checked in CI pipeline. Link is attached in JBS.
>
> Abhishek Kumar has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
>
> - ProblemList.txt file merge resolved
> - 8295006 entry removed from problem lists
> - Fix for disabled checkbox and radiobutton colored text
Something like this should work I think:
checkBox = new JCheckBox("\u2588".repeat(5));
UIDefaults checkBoxDefaults = new UIDefaults();
checkBoxDefaults.put("CheckBox.textForeground", checkboxColor);
checkBox.putClientProperty("Nimbus.Overrides",checkBoxDefaults);
radioButton = new JRadioButton("\u2588".repeat(5));
UIDefaults radioDefaults = new UIDefaults();
radioDefaults.put("RadioButton.textForeground", radioButtonColor);
radioButton.putClientProperty("Nimbus.Overrides",radioDefaults);
-------------
PR: https://git.openjdk.org/jdk/pull/10755
More information about the client-libs-dev
mailing list