copy/paste : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

copy/paste

In most Windows apps, you can copy a snippet of selected text to the clipboard with Ctrl-C. You can then paste it somewhere else with Ctrl-V. You can copy and delete in one operation with Ctrl-X. Java AWT (Advanced Windowing Toolkit) apps and Applets support copy/paste without writing any code, as do Java Swing apps.

Ostensibly to close security holes, As of JDK (Java Development Kit) 1.6.0_24, Java Swing JApplets do not support copy/paste, (Ctrl-C/Ctrl-V in Windows) unless you sign the Applet.

You can access the clipboard as a whole in signed Swing JApplets using code similar to this ClipboardPoker code part of the common18 package.

Making Ctrl-C/Ctrl-V Work Again

What can you do to make ordinary Ctrl-C/Ctrl-V work with unsigned Swing Applets in JDK 1.6.0_24+?

Why did Oracle do this?

Here is my speculation: Ctrl-C and Ctrl-V should be completely safe. The program cannot use them to sneakily peek at the clipboard without the user knowing. They are handled without application program involvement. However Copy/Paste menu buttons can, since the program intervenes and can trigger the same actions even without user input. It could be handled two ways. Let Ctrl-C and Ctrl-V work always and the buttons only work when signed, or they could have everything work only when signed. Oracle chose consistency over convenience.


This page is posted
on the web at:

http://mindprod.com/jgloss/copypaste.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\copypaste.html
logo
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[54.91.11.11]
You are visitor number