Java Swing Tutorial - Java DataFlavor.getMimeType()


DataFlavor.getMimeType() has the following syntax.

public String getMimeType()


In the following code shows how to use DataFlavor.getMimeType() method.

/*from w  ww . ja va  2 s  .co  m*/
import java.awt.datatransfer.DataFlavor;

public class Main {

  public static void main(String[] args) {

    DataFlavor df = DataFlavor.stringFlavor;

    System.out.println ("Mime type: " + df.getMimeType ());

The code above generates the following result.