mardi 26 juillet 2016

How do I append text to a specific position of JTextArea (Java)?

I have a determined text in a JTextArea and want to add text to a specific position (more specifically, before every line feed), depending on a user's action.

Example:

Lorem ipsum

Dolor sit amet

To:

Lorem ipsum {text here}

Dolor sit amet {another text here}

I tried JTextArea.append(String) method, but it doesn't give me the option of choosing where to place the text.

Aucun commentaire:

Enregistrer un commentaire