RFR: 7188058: Background of TextComponents are not changing colors to the default disabled color when set to uneditable [v2]

Alisen Chung achung at openjdk.org
Thu Aug 8 01:22:42 UTC 2024


On Tue, 6 Aug 2024 09:25:55 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> This call is only to get the default background of TextArea. Is there another way to grab the default color without using UIManager?
>
> Yes, but as far I could see `TextArea.background` property is being set in 
> `AquaLookAndFeel.java, MotifLookAndFeel.java, BasicLookAndFeel.java, XAWTLookAndFeel.java and WindowsLookAndFeel.java`
> and this L&F will not be set in AWT environment, if I am not wrong so you will either get garbage or wrong default color if you use UIManager.getColor..so I guess you need to use `TextComponent.getBackground()` which returns SystemColor.control if nothing is set

i've made the change to use TextComponent.getBackground() instead to get the correct background color

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19876#discussion_r1708330280


More information about the client-libs-dev mailing list