Changing Font in JTextArea for new text only

50 views Asked by At

I am using a JTextArea for a text editor program. Text in the text area is provisionally set in the constructor using:

teaxtArea.setFont("Serif", Font.PLAIN, 14);

I have added event handlers that allow user to select various font styles and sizes. However when the new changes are applied via the setFont method the text already in the text area is changed.

Is it possible to apply the new font to new text only?

0

There are 0 answers