Here you can find the source of isImageDataFlavor(Clipboard clip)
public static boolean isImageDataFlavor(Clipboard clip)
//package com.java2s; /*/*from w w w.j av a2s . com*/ * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: * */ import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.io.InputStream; public class Main { /** * test if data flavor has mime type x-java-image */ public static boolean isImageDataFlavor(Clipboard clip) { DataFlavor fl[] = clip.getAvailableDataFlavors(); if (fl.length > 0) { DataFlavor f = fl[0]; if ("image".equals(f.getPrimaryType())) { if (InputStream.class.getName().equals( f.getDefaultRepresentationClassAsString())) return true; } } return false; } }