import java.text.SimpleDateFormat; SimpleDateFormat df = new SimpleDateFormat( "EEE d MMMM yyyy HH:mm:ss" ); textArea.setSelectedText(""); textArea.insertEnterAndIndent(); textArea.insertTabAndIndent(); textArea.setSelectedText(""); textArea.insertEnterAndIndent(); textArea.setSelectedText(""); textArea.setSelectedText( df.format( new Date() ) + ""); textArea.insertEnterAndIndent(); textArea.setSelectedText(""); textArea.insertEnterAndIndent(); textArea.backspace(); textArea.backspace(); textArea.backspace(); textArea.backspace(); textArea.setSelectedText(""); textArea.goToPrevLine(false); textArea.goToPrevLine(false); textArea.goToPrevLine(false); textArea.goToNextCharacter(false); textArea.goToNextCharacter(false); textArea.goToNextCharacter(false); textArea.goToNextCharacter(false);