RFR: 7175396: The text on label is not painted red for Nimbus LaF. [v4]

Alexey Ivanov aivanov at openjdk.org
Wed Sep 28 15:06:15 UTC 2022


On Wed, 28 Sep 2022 07:02:45 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> Label.foreground UIProperty is not honored by Nimbus L&F.
>> Added support for setting JLabel foreground color for Nimbus L&F
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Test fix

test/jdk/javax/swing/plaf/nimbus/TestNimbusLabel.java line 47:

> 45: {
> 46:     private static JFrame frame;
> 47:     private static int colorTolerance = 5;

Let's add `final` to the constant.

test/jdk/javax/swing/plaf/nimbus/TestNimbusLabel.java line 61:

> 59:             return true;
> 60:         }
> 61:         return false;

Could be simplified to return `<condition>;`

I wonder if this test should also verify the number of pixels of correct color as done in #10177.

test/jdk/javax/swing/plaf/nimbus/TestNimbusLabel.java line 106:

> 104:                     robot.createScreenCapture(new Rectangle(p.x, p.y,
> 105:                             d.width,
> 106:                             d.height));

Suggestion:

                    robot.createScreenCapture(new Rectangle(p, d));

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

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



More information about the client-libs-dev mailing list