I did a search for this and found a dead link, so I'll ask again.

How do I incorporate cut/copy/paste code into a JTextArea/JTextField?