void () { // Move caret to the non-zero column. myEditor.getCaretModel().moveToOffset(3); // Select all text. myEditor.getSelectionModel().setSelection(0, myEditor.getDocument().getTextLength()); // Perform 'copy-paste' action. Expecting to get the same file. copy(); paste(); }