JTextPane « JTextField « Java Swing Q&A





1. Making words different colors in JTextField/JTextPane/?    stackoverflow.com

I'm trying and failing to understand how to use Java's text editor components to colorize text as you insert it. I don't want or need a fully featured syntax highlighting library. Basically, ...

2. text selection conflict between JTextPane and JTextField    stackoverflow.com

Why the text in JTextPane cannot be selected programmatically if there is a JTextField present? Has something to do with focus i think. Thx.

import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.beans.PropertyChangeListener;

import javax.swing.AbstractAction;
import ...