Modifying Text in a JTextArea Component : TextArea « Swing JFC « Java
- Java
- Swing JFC
- TextArea
Modifying Text in a JTextArea Component
import javax.swing.JTextArea;
public class Main {
public static void main(String[] argv) {
// Create the text area
JTextArea ta = new JTextArea("Initial Text");
// Insert some text at the beginning
int pos = 0;
ta.insert("some text", pos);
}
}
Related examples in the same category