public class ClipboardHelper extends Object
| Constructor and Description |
|---|
ClipboardHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canPasteFromClipboard(DataFlavor flavor)
Checks whether the specified "flavor" can be obtained from the clipboard.
|
static boolean |
canPasteImageFromClipboard()
Checks whether a string can be obtained from the clipboard.
|
static boolean |
canPasteStringFromClipboard()
Checks whether a string can be obtained from the clipboard.
|
static void |
copyToClipboard(BufferedImage img)
Copies the given image to the system's clipboard.
|
static void |
copyToClipboard(JComponent comp)
Copies the given JComponent as image to the system's clipboard.
|
static void |
copyToClipboard(JTable table)
Copies the given JTable as text to the system's clipboard.
|
static void |
copyToClipboard(String s)
Copies the given string to the system's clipboard.
|
static void |
copyToClipboard(Transferable t)
Copies the given transferable to the system's clipboard.
|
static Object |
pasteFromClipboard(DataFlavor flavor)
Obtains an object from the clipboard.
|
static BufferedImage |
pasteImageFromClipboard()
Obtains a BufferedImage from the clipboard.
|
static String |
pasteStringFromClipboard()
Obtains a string from the clipboard.
|
public static void copyToClipboard(Transferable t)
t - the transferable to copypublic static void copyToClipboard(String s)
s - the string to copypublic static void copyToClipboard(BufferedImage img)
img - the image to copypublic static void copyToClipboard(JComponent comp)
comp - the component to copyBufferedImage.TYPE_INT_RGBpublic static void copyToClipboard(JTable table)
table - the table to copypublic static boolean canPasteFromClipboard(DataFlavor flavor)
flavor - the type of data to look forpublic static boolean canPasteStringFromClipboard()
public static boolean canPasteImageFromClipboard()
public static Object pasteFromClipboard(DataFlavor flavor)
flavor - the type of object to obtainpublic static String pasteStringFromClipboard()
public static BufferedImage pasteImageFromClipboard()
BufferedImage.TYPE_INT_RGBCopyright © 2016. All rights reserved.