Java Swing Tutorial - Java DataFlavor.clone()


DataFlavor.clone() has the following syntax.

public Object clone()  throws CloneNotSupportedException


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

import java.awt.datatransfer.DataFlavor;
//  w  ww. j  a  v  a  2  s.  c om
public class Main {

  public static void main(String[] args) {

    DataFlavor df = DataFlavor.stringFlavor;

    try {
      System.out.println (df.clone());
    } catch (CloneNotSupportedException e) {

The code above generates the following result.