I’m trying to build a program that supplements and replaces Windows shortcuts with those defined by the user. Currently, I’m working on building a copy/paste function, but can’t figure out how to move the copied object into a program other than mine. I tried using the Robot class to simulate keypresses depending on the value at a specific index in a string, but that won’t allow me to pass variables other than the VKEY constants.
What would be needed in a method to copy and paste text between programs?
If you would consider using JavaFX: There is a Clipboard class, which claims to get the system clipboard, but I haven’t tried if it works accross (non-JavaFX) applications:
http://docs.oracle.com/javafx/2/api/javafx/scene/input/Clipboard.html
Edit:
There is also an AWT-based Clipboard: http://docs.oracle.com/javase/7/docs/api/java/awt/datatransfer/Clipboard.html