public class ClipboardManager
extends java.lang.Object
Constructor and Description |
---|
ClipboardManager() |
Modifier and Type | Method and Description |
---|---|
static void |
copyToClipboard(java.lang.String clipboardText)
Writes a String to the system's/user's clipboard.
|
static java.awt.datatransfer.Clipboard |
getSystemClipboard()
Returns the Clipboard object that Java keeps synchronized with the OS's clipboard.
|
void |
pasteClipboardTo(javax.swing.text.JTextComponent jtc)
Pastes the content of the system clipboard to the specified JTextComponent.
|
void |
pasteClipboardTo(java.awt.TextComponent tc)
Pastes the content of the system clipboard to the specified TextComponent.
|
java.lang.String |
readSystemClipboard()
Return the content of the system's/user's clipboard as a String.
|
public static void copyToClipboard(java.lang.String clipboardText)
clipboardText
- the text to copy to the clipboardpublic static java.awt.datatransfer.Clipboard getSystemClipboard()
public java.lang.String readSystemClipboard()
public void pasteClipboardTo(javax.swing.text.JTextComponent jtc)
jtc
- a JTextComponentpublic void pasteClipboardTo(java.awt.TextComponent tc)
tc
- a TextComponent