how to change all the text in a textArea java at once

Java
JTextArea textArea = ...;

textArea.setText("Hello World");
Source

Also in Java: