Set the color behind the selected text : JTextComponent « Swing JFC « Java
- Java
- Swing JFC
- JTextComponent
Set the color behind the selected text
import java.awt.Color;
import javax.swing.JTextArea;
import javax.swing.text.JTextComponent;
public class Main {
public static void main(String[] argv) {
JTextComponent c = new JTextArea();
c.setSelectionColor(Color.green);
}
}
Related examples in the same category