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 common11 package.
What can you do to make ordinary Ctrl-C/Ctrl-V work with unsigned Swing Applets in JDK 1.6.0_24+?
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.
|
|
You can get the freshest copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) |
| http://mindprod.com/jgloss/copypaste.html | J:\mindprod\jgloss\copypaste.html | |
![]() | ||
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.179.213] | |
| Feedback | You are visitor number 11. | |