Java Swing Tutorial - Java DataFlavor.equals(DataFlavor that)








Syntax

DataFlavor.equals(DataFlavor that) has the following syntax.

public boolean equals(DataFlavor that)

Example

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

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

  public static void main(String[] args) {

    DataFlavor df = DataFlavor.stringFlavor;
    System.out.println (df.equals(DataFlavor.imageFlavor));
  }
}

The code above generates the following result.