Search code examples
javaswinguser-interfacejtextarea

How to change the colour of JTextArea when it is not editable?


When I make JTextArea to display text but not edit it. It will become blue and not visible clearly. How to change the colour of JTextArea when it is not editable?


Solution

  • Try to use this:

    JTextArea a = new JTextArea("test");
    a.setEnabled(false);
    a.setDisabledTextColor(Color.red);