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 System Clipboard

As you can see in Figure 20-1, our first applet contains a textfield, a textarea, and two buttons. After text is typed into the textfield, activating the Copy To System Clipboard button places the textfield's text onto the system clipboard. Subsequently, activating the “Paste From System Clipboard” button retrieves the text currently on the clipboard and places it in the textarea.

Figure 20-1. Copying a String to the System Clipboard. Activating the Copy To System Clipboard button copies the text from the textfield and places it on the system clipboard.

Before listing the applet in its entirety, let's take a look at the code ...

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