import lotus.domino.*; import java.io.IOException; import java.awt.Toolkit; import java.awt.datatransfer.*; // show how easy it is to move Strings to/from the system Clipboard in Java public class JavaAgent extends AgentBase { public void NotesMain() { try { // get the system clipboard Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); // write to it clipboard.setContents(new StringSelection("Java clipboard data"), null); // read from it String clipboardData = ""; Transferable content = clipboard.getContents(null); if (content != null) clipboardData = (String)content.getTransferData(DataFlavor.stringFlavor); System.out.println(clipboardData); } catch(Exception e) { e.printStackTrace(); } } }