1
How to change, say, the font of one or more characters of a JTextField
allowing them to be underlined, bold or italic? But, the rest of the text would be normal. But in this case I need to specifically underline some characters of a JTextField
.
Can you illustrate what you want to do with some print? And add what you have already tried to do also so that the question is not closed as "too wide" or "is not clear"
– user28595
Ah, Jtextfield can’t do what you want, or alter his entire text or change none. You will have to use Jtextpane or Jeditorpane. In this my answer have an example, see if it suits you.
– user28595
You can use html to highlight only some characters of a text of some Swing components (https://docs.oracle.com/javase/tutorial/uiswing/components/html.html).
– Giuliana Bezerra