Throughout the internet I just found people wanting to know how to style part of the text and being "redirected" to JTextPane
, so there are no answers to my question out there.
So there goes: I have a JTextArea
in a JFrame
how can I change the font color of the entire text of JTextArea
?
Current code:
import javax.swing.*;
import java.awt.*;
class MyFrame extends JFrame{
private JTextArea text;
public MyFrame(){
text = new JTextArea();
text.setBackground(Color.BLACK);
text.setFont(new Font("Consolas", Font.BOLD, 14));
//Trocar cor da fonte para branco aqui...
}
}