O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Clipboard Class

java.awt.datatransfer.Clipboard is an extremely simple class. There are only three things you can do to a clipboard, other than construct one, as you can see from Table 20-2: get the name of the clipboard, set the contents of the clipboard, and retrieve the current contents of the clipboard. Notice that there is no setName method—setting the name of the clipboard is done at construction time. Furthermore, you can either create a local clipboard via the Clipboard constructor or you can obtain a reference to the system clipboard by invoking Toolkit.getSystemClipboard().

Table 20-2. java.awt.datatransfer.Clipboard Public Methods
Method Description
String getName() Returns the name of the clipboard
void setContents(Transferable, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required