Re: copy paste
On 01/03/2011 10:42, Roedy Green allegedly wrote:
On Mon, 28 Feb 2011 21:28:38 +0100, Daniele Futtorovic
<da.futt.news@laposte-dot-net.invalid> wrote, quoted or indirectly
quoted someone who said :
You sure about that? I wouldn't be surprised if it weren't separate.
see
http://wush.net/svn/mindprod/com/mindprod/common11/ClipboardPoker.java
You can peek and poke the clipboard in AWT or Swing completely
independently of a JTextArea or JTextField.
The ctrl-C ctrl-V stuff happens without any code. It lets people
copy/paste text fragments to JTextAreas and JTextFields SO LONG AS
they are running as applications, not JApplets.
I've had a look at the copy/paste in JTextComponent. It eventually leads
to this method in javax.swing.TransferHandler:
private Clipboard getClipboard(JComponent c) {
if (SwingUtilities2.canAccessSystemClipboard()) {
return c.getToolkit().getSystemClipboard();
}
Clipboard clipboard = (Clipboard)sun.awt.AppContext.getAppContext().
get(SandboxClipboardKey);
if (clipboard == null) {
clipboard = new Clipboard("Sandboxed Component Clipboard");
sun.awt.AppContext.getAppContext().put(SandboxClipboardKey,
clipboard);
}
return clipboard;
}
When you say you can't cut'n paste, do you mean within the Applet or
from the Applet to the outside and vice-versa?