java.awt.datatransfer.StringSelection (JDK 1.1)
This convenience class implements the Transferable and ClipboardOwner interfaces in order to make it very easy to transfer String values through the AWT data transfer mechanism. It is able to transfer String values using either the DataFlavor.stringFlavor or DataFlavor.plainTextFlavor data flavors.
To create a StringSelection object, simply pass the String you want to transfer to the StringSelection() constructor. You can then make the StringSelection available for transfer by passing it to the setContents() method of the Clipboard. You need never call the methods of StringSelection yourself.
public classStringSelectionextends Object implements Transferable, ClipboardOwner { //Public ConstructorpublicStringSelection(Stringdata); //Public Instance Methodspublic synchronized ObjectgetTransferData(DataFlavorflavor) public synchronized ObjectgetTransferData'u'throws UnsupportedFlavorException, IOException; public synchronized ObjectgetTransferData'u'//From Transferablepublic synchronized DataFlavor[]getTransferDataFlavors(); //From Transferablepublic booleanisDataFlavorSupported(DataFlavorflavor); //From Transferablepublic voidlostOwnership(Clipboardclipboard, Transferablecontents); //From ClipboardOwner}