there is already a function for cut-copy-paste in java. you just need to call it ^_^
I also made a javapad almost like notepad but can compile and run java ^_^
But cant handle errors T_T
Here is a sample code from my javapad, it is for cut
Action cutAction = textArea.getActionMap().get(DefaultEditorKit.cutAction);
cutItem = editMenu.add(cutAction);
cutItem.setText("Cut");