DataFlavor: isMimeTypeEqual(DataFlavor dataFlavor)
/*
Mime type: application/x-java-serialized-object; class=java.awt.Button
Primary type: application
Subtype: x-java-serialized-object
Name: AWT Button
Representation class: class java.awt.Button
df1 equals df2: false
*/
import java.awt.datatransfer.DataFlavor;
public class MainClass {
public static void main(String[] args) {
DataFlavor df1 = new DataFlavor("text/plain; charset=ASCII", "Plain ASCII text");
DataFlavor df2 = new DataFlavor(java.awt.Button.class, "AWT Button");
System.out.println("Mime type: " + df2.getMimeType());
System.out.println("Primary type: " + df2.getPrimaryType());
System.out.println("Subtype: " + df2.getSubType());
System.out.println("Name: " + df2.getHumanPresentableName());
String s = df2.getRepresentationClass().toString();
System.out.println("Representation class: " + s + "\n");
System.out.println("df1 equals df2: " + df1.isMimeTypeEqual(df2));
}
}
Related examples in the same category