I have a disabled JTextField and due to readability problems i want to make the font black again. So that it looks like its not disabled, but i cant edit it. any suggestions?
Approach: With adding basic CSS property we are able to change the font-color of a disabled input. The disabled input element is unusable and un-clickable. This is a boolean attribute. Here using the color property of input we can change the font-color of this disabled input element.
You can use the setDisabledTextColor(Color c)
method to set the desired color. For more information check: javadocs
Try using the method setDisabledTextColor (inherited from JTextComponent)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With