Monday, January 26, 2009

membaca clipboard di java

cara membaca clipboard di java
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.Toolkit;


public class TestClipboard
{
public static void main(String args[]) throws Exception
{
Toolkit t = Toolkit.getDefaultToolkit() ;
Clipboard cb =t.getSystemClipboard();
String s = (String) cb.getData(DataFlavor.stringFlavor);

System.out.println(s);
}
}

No comments:

Post a Comment