<Swing Dev> RFR: 8271923: [macos] the text color on the selected disabled tabbed pane button remains white making text unreadable [v2]

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Mon Sep 6 09:07:42 UTC 2021


On Mon, 6 Sep 2021 08:00:36 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> It is seen that  if a JTabbedPane is unfocused, it's title is painted with **white** text on grey background 
>> as opposed to **black** text on grey background in unfoucsed native app on macOSX Catalina
>> and is somewhat not legible. 
>> This can be seen with SwingSet2 demo with InternalFrame or JTabbedPane demo and any native app, making focus toggle between the two.
>> 
>> Issue was TabbedPane always draw with "selectedTabTitleNormalColor" which is white. Although Aqua L&F defined selectedTabTitleDisabledColor but it is not used as TabbedPane does not check if focus is there in current frame and draw accordingly, which native app does.
>> 
>> Proposed fix is to check for frame is active or not and draw text color accordingly. 
>> Since it is not affecting BigSur (where even if native app active or not text is always drawn in same color), it is only restricted to Catalina and lower.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use NonFocus color

It will be difficult to prove the issue for text color as robot will pick the pixels for tabbedpane along with background, not only text. Also, it's not for all macos, it's only for Catalina...we don't have requires tag to omit specific macos..

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

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


More information about the swing-dev mailing list