X has a mechanism called "selection" that supports cut and
paste. Selection associates data with a named buffer for transferring
between applications; you can name a buffer anything you want, but two
names have special meaning:
CLIPBOARD - this is the buffer used by applications that provide buttons
and/or keyboard shortcuts for copy, cut, and paste.
PRIMARY - this is the buffer used for data you drag/highlight with the
left mouse button.
The Java AWT only supports the first one - that's the one you're accessing
with getSystemClipboard(). If you want to get to the PRIMARY buffer,
you need to write some JNI code. Why doesn't AWT support the second one?
Because most other platforms don't have a comparable feature.
Nathan Meyers
[EMAIL PROTECTED]
On Sun, Apr 15, 2001 at 04:01:11PM -0500, Dick Repasky wrote:
>
> Why doesn't a call to getSystemClipboard give me what's in the
> system clipboard? Briefly, I'm working under Linux using X
> windows. I load something into the system clipboard from an
> xterm using the left mouse button. Then, when I move into my
> application and click on a home-grown paste button that
> uses the getSystemClipboard call, I get nothing. Ironically,
> X11 copy and paste operations that rely solely on the left and
> middle mouse buttons work fine. I can also copy into the system
> clipboard using the mouse in an xterm and then paste directly
> into an editable TextArea just fine.
>
> I'm coming to the conclusion that what java thinks is the system
> clipboard isn't that at all.
>
> What I'd like is a nice unified cut/copy/paste system. That is,
> I'd like to cut/copy/paste within an editable TextArea as
> well as to cut/copy/paste between the text area and other
> applications in Linux and Windows 98, using the mouse buttons
> and/or cut/copy/paste buttons that are home-grown MenuItems,
> complete with ctrl-x,c,v shortcuts.
>
> So, if Java's system clipboard isn't really the system clip
> board, what is it?
>
> Thanks,
>
> Dick
>
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
>
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]