RFR: 8226990: GTK & Nimbus LAF: Tabbed pane's background color is not expected one when change the opaque checkbox. [v6]

Prasanta Sadhukhan psadhukhan at openjdk.org
Wed Apr 3 08:59:03 UTC 2024


On Tue, 2 Apr 2024 17:32:26 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:

>> JTabbedPane's content area, tab area and tab background color are not as expected when opaque is set to true or false. 
>> The proposed fix is to handle the TabbedPane's background color in installed LAFs. Manual test is added to support the fix and there is no regression caused by the fix. 
>> 
>> Proposed fix is tested in Ubuntu 22.04 and Oracle linux.
>> 
>> CI link is posted in JBS.
>
> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Test update

src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java line 351:

> 349:         Color caretColor = table.getColor("caretColor");
> 350:         Color controlText = table.getColor("controlText");
> 351:         Color tabbedPaneBg = new Color(238, 238, 238);

Shouldn't it be ColorUIResource?

src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java line 776:

> 774: 
> 775:         // fill content area rect for both GTK and Nimbus LAF here
> 776:         g.fillRect(x, y, w, h);

shouldn't it be within if block as is done in BasicTabbedPaneUI so that we fill only if it's opaque

test/jdk/javax/swing/JTabbedPane/TestJTabbedPaneOpaqueColor.java line 56:

> 54:     private static final String INSTRUCTIONS = """
> 55:             The background color of panel (which contains the tabbed pane
> 56:                     is green.

instructions formatting needed..lot of empty spaces in the instruction dialog...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17720#discussion_r1549254047
PR Review Comment: https://git.openjdk.org/jdk/pull/17720#discussion_r1549271306
PR Review Comment: https://git.openjdk.org/jdk/pull/17720#discussion_r1549283850


More information about the client-libs-dev mailing list