import java.awt.datatransfer.*;
복사 하는 방법 (자바->클립보드)
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
String copyString = textArea.getSelectedText();
if(copyString != null)
{
StringSelection contents = new StringSelection(copyString);
clipboard.setContents(contents, null);
}
꺼내오는(붙여넣기) 방법 (클립보드->자바)
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable contents = clipboard.getContents(clipboard);
if(contents != null)
{
try {
String pasteString = (String)(contents.getTransferData(
DataFlavor.stringFlavor));
textArea.insert(pasteString, textArea.getCaretPosition());
} catch (Exception e) {}
}