Mega Code Archive

 
Categories / Java Tutorial / Swing
 

Insert some text after the 5th character

import javax.swing.JTextArea; public class Main {   public static void main(String[] argv) {     JTextArea ta = new JTextArea("Initial Text");     int pos = 5;     ta.insert("some text", pos);   } }