StringSelection

StringSelection is a convenience class that can be used for copy and paste operations on Unicode text strings (String). It implements both the ClipboardOwner and Transferable interfaces, so it can be used both as the contents of the clipboard and as its owner. For example, if s is a StringSelection, you can call Clipboard.setContents(s,s). StringSelection supports both stringFlavor and plainTextFlavor and doesn't do anything when it loses clipboard ownership.

StringSelection Methods

Constructors Miscellaneous methods