Java DataFlavor.match(DataFlavor that)

Syntax

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

public boolean match(DataFlavor that)

Example

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


//  w  ww .ja v a 2  s .c om
import java.awt.datatransfer.DataFlavor;

public class Main {

  public static void main(String[] args) {

    DataFlavor df1 = new DataFlavor("text/plain; charset=ASCII", "Plain ASCII text");

    DataFlavor df2 = new DataFlavor(java.awt.Button.class, "AWT Button");

    System.out.println("df1 equals df2: " + df1.match(df2));
  }
}




















Home »
  Java Tutorial »
    java.awt.datatransfer »




Clipboard
ClipboardOwner
DataFlavor
Transferable