Hey guys.
Basically, I have taken it upon myself to attempt to write a Java version of Microsoft's NotePad for my school final. It's not incredibly difficult, but I have determined that I would like to use Windows' clipboard for my cut, copy, and paste operations. The jre has these functions listed under javax.swing.TransferHandler, but I have been unable to make this work. Instead, I tried to use the awt window toolkit like this:
My output would be what looks like a hex memory address, like this:
If anyone knows a method to copy to or from the windows clipboard, throw me a bone here!
Thanks in advance!
Basically, I have taken it upon myself to attempt to write a Java version of Microsoft's NotePad for my school final. It's not incredibly difficult, but I have determined that I would like to use Windows' clipboard for my cut, copy, and paste operations. The jre has these functions listed under javax.swing.TransferHandler, but I have been unable to make this work. Instead, I tried to use the awt window toolkit like this:
text.replaceSelection(this.getToolkit().getSystemClipboard().getContents(this.getToolkit().getSystemClipboard().getName()).toString());
My output would be what looks like a hex memory address, like this:
sun.awt.datatransfer.ClipboardTransferable@15311bd
If anyone knows a method to copy to or from the windows clipboard, throw me a bone here!
Thanks in advance!