<Swing Dev> RFR: 8251377: [macos11] JTabbedPane selected tab text is barely legible

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Tue Nov 24 08:50:57 UTC 2020


On Thu, 19 Nov 2020 18:56:43 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> In Mohave, native System Preferences->Display tabs has 
>> white-text-on-blue-background when windows is focused
>> black-text-on-lightgray-background when window is unfocused
>> 
>> In macos11, it is always black-text-on-white-background whether focused/unfocused.
>> 
>> Current JDK tabpane always shows black background (when tab is selected) which is not configurable, at least I could not change it. Only thing i could change is the foreground text color. 
>> As was told to get color from native, I could see only "selectedTextBackground" and "selectedControlColor" works on both pre-macos11 and macos11 as it gives bluish text color which is legible on black (mohave) and white (macos11) background.
>> 
>> All other native-obtained-colors like selectedTextColor, selectedControlTextColor, controlTextColor, textBackgroundColor either gives black or white which is not legible on either pre-macos11 or macos11, so was not used.
>
> Then try to dig into it a little bit, probably a good reason to ask about the current font color in the tab at the Apple forum.

Tried to find and change tabpane background color for "selected" tab but unable to do so. 
Tried changing AquaLookAndFeel.tabBackgroundColor, TabbedPane.background color to no avail. Tried to set background by calling tabPane.setbackground() in AquaTabbedPaneUI.installDefaults but it sets background for non-selected tab (keeping black background for selected tab in mohave unchanged). I see it's been like that at least from jdk8GA.
Post to apple forum is unanswered.

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

PR: https://git.openjdk.java.net/jdk/pull/1182


More information about the swing-dev mailing list