Replace the first 3 characters with some text : TextArea « Swing JFC « Java
- Java
- Swing JFC
- TextArea
Replace the first 3 characters with some text
import javax.swing.JTextArea;
public class Main {
public static void main(String[] argv) {
JTextArea ta = new JTextArea("Initial Text");
int start = 0;
int end = 3;
ta.replaceRange("new text", start, end);
}
}
Related examples in the same category