Simiil
Simiil

Reputation: 2311

Java set Font Color in a disabled Text Field

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?

Upvotes: 11

Views: 19451

Answers (3)

Fauziya
Fauziya

Reputation: 21

Please use setDisabledTextColor(Color.BLACK) to make your text color black.

Upvotes: 2

Faisal Feroz
Faisal Feroz

Reputation: 12785

You can use the setDisabledTextColor(Color c) method to set the desired color. For more information check: javadocs

Upvotes: 23

JohnoBoy
JohnoBoy

Reputation: 565

Try using the method setDisabledTextColor (inherited from JTextComponent)

Upvotes: 6

Related Questions