you would have to use the system clipboard
here is a snippet of code i found on the internet:
Code:
public void clpbrd()
{
System.out.println("Clipboard stuff");
try
{
//blah blah
Clipboard clip = this.getToolkit().getSystemClipboard();
if(clip == null) throw new IOException("No clipboard in scene");
//blah blah
Transferable trans = clip.getContents(this);
//blah blah
if( trans == null) throw new IOException("Clipboard Empty");
//******************
String s = (String) trans.getTransferData(DataFlavor.stringFlavor);
//***************
_textArea.replaceRange(s, _textArea.getSelectionStart(),
_textArea.getSelectionEnd());
}
catch(Exception e)
{
//do smthng.
}
}
hope it helps
Bookmarks