Java Swing Tutorial - Java DataFlavor.getPrimaryType()


DataFlavor.getPrimaryType() has the following syntax.

public String getPrimaryType()


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

/*from   ww w .  ja  v  a  2s. c  o m*/
import java.awt.datatransfer.DataFlavor;

public class Main {

  public static void main(String[] args) {

    DataFlavor df = DataFlavor.stringFlavor;

    System.out.println (df.getPrimaryType ());

The code above generates the following result.