Java Toolkit.getSystemClipboard()
Syntax
Toolkit.getSystemClipboard() has the following syntax.
public abstract Clipboard getSystemClipboard() throws HeadlessException
Example
In the following code shows how to use Toolkit.getSystemClipboard() method.
import java.awt.Toolkit;
/*from w w w . j a va 2 s .com*/
public class Main {
public static void main(String[] args) {
Toolkit tk = Toolkit.getDefaultToolkit();
System.out.println("System clipboard = " + tk.getSystemClipboard());
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »