Java Swing Tutorial - Java DataFlavor .getParameter (String paramName)








Syntax

DataFlavor.getParameter(String paramName) has the following syntax.

public String getParameter(String paramName)

Example

In the following code shows how to use DataFlavor.getParameter(String paramName) method.

import java.awt.datatransfer.DataFlavor;
/*from w w  w. j  ava  2 s .  com*/
public class Main {

  public static void main(String[] args) {

    DataFlavor df1 = new DataFlavor("text/plain; charset=ASCII",
        "Plain ASCII text");
    System.out.println(df1.getParameter(df1.getHumanPresentableName()));

  }
}

The code above generates the following result.