Java Example Program / Sample Source Code
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
public class IsDataFlavorAvailableExample{
public static void main(String[] argv) throws Exception {
DataFlavor dataFlavor = new DataFlavor("text/plain; charset=ASCII", "Plain ASCII text");
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
boolean flag = clipboard.isDataFlavorAvailable(dataFlavor);
System.out.println("isDataFlavorAvailable "+flag);
}
} |
|
|