This discussion inspired me into a burst of frenzied activity, and I've
written a simple JNI-based solution. Check out XClipboard at
http://www.teleport.com/~nmeyers/FreeWare/ . Works with 1.1 and 1.2;
tested on RedHat 6.0 but should be widely usable in Linux and Unix
environments.

XClipboard handles the problem of getting the pasted bits from X.
Calling it from a mouse action is left as an exercise to the reader :-).

Nathan


Larry Gates wrote:
> 
> I looked into this problem a while ago and pretty much gave up on it.
> If anyone knows the answer, I would also very much like to know.
> 
> I, too, can get cut-n-paste via Netscape's "Edit/Copy" menu, and then
> use Java's java.awt.datatransfer.Clipboard method as described in a
> past document on the Java Developer Connection.  This is nice, but I
> can't paste a highlighted text portion from the mouse, which we Linux
> users all like to do.
> 
> *Even* if I could call a c-routine (i.e. a modified xcutsel.c?) to
> grab the text from this buffer, I would be happy.  It's not ideal, but
> to make it platform-independent, we could program a check on the OS
> (use java.lang.System.getProperties), and if it comes back as Linux,
> then implement the c-routine.
> 
> >Date: Wed, 28 Jul 1999 16:06:04 -0700 (PDT)
> >From: Dustin Lang <[EMAIL PROTECTED]>
> 
> >Hi,
> >
> >I've been trying to get cut-n-paste working in my application (drag-n-drop
> >works nicely, at least intra-vm).  Doing a copy from netscape (via the
> >Copy menu item) works (pasting into a textfield using CTRL-V), as does
> >copying from my app to netscape (via a popup menu on the java side and the
> >Paste menu item on the netscape side).  While this is good, what I'd
> >really like is to allow copying by highlighting, and pasting by pressing
> >button 3, the way xterm, netscape, and other apps do.  I searched the
> >archives and found some discussion about this and it seemed the problem
> >related to there being at least two different clipboard buffers.  This
> >seems to make sense, and java seems to be able to use one type (the
> >CLIPBOARD clipboard?), but not the other (a cut buffer?).  Has anyone had
> >any success or failure with button 3 pasting?  Care to share your
> >findings?
> >
> >Thanks,
> >dstn.
> 
> --
> Larry Gates
> 
> ----------------------------------------------------------------------
> 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]

Reply via email to