5
All over the internet I just found people wanting to know how to stylize part of the text and being "redirected" to JTextPane
, then there are no answers to my question around.
So there you go: I got one JTextArea
in a JFrame
how can I change the font color of any text in the 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...
}
}