> Steve Zara wrote:
> [snip-my demo that pasting from system clipboard can be done]
> > >
> > Thanks - this works fine as illustrated.  I'm more used to using the 
>highlight/middle button click
> > copy/paste action under X - is there any way this can be accessed from Java?
> 
> This sort of thing works on my system, at least when I push both mouse
> buttons simultaneously (I don't _have_ a middle mouse button):
> -------------
> import java.applet.*;
> import java.awt.*;
> import java.awt.event.*;
> //<applet code="mouser2.class" width=300 height=300></applet>
> public class mouser2 extends Applet {
> 
>     public void init() {
>         this.addMouseListener(new MouseAdapter() {
>             public void mousePressed(MouseEvent e) {
>                 if(e.getModifiers() == InputEvent.BUTTON2_MASK)
>                     System.out.println("middle button pushed");
>             }
>         });
>     }
> }
> ---------------
> Bob L.
> -- 
> Robert Lynch-Berkeley CA [EMAIL PROTECTED]
> http://www.best.com/~rmlynch/
> 
Yes - but the problem is, getting at the selected text in another X-window.
I want to use IFC or Swing classes for my application, so I can't simply use
the middle button on X to get text transferred.  I naively thought that
all this would be handled by the Clipboard classes, but the clipboard
in X seems to be something else altogether.... my knowlede of X programming
is minimal.

What I want to do is to be able to access the text that is highlighted in an
xterm or on a netscape window.  The convention in X is that once highlighted,
you can paste this text somewhere else using a middle button press.
This works fine if you use java.awt.* classes, but I am not, for reasons
of display portability. I assume the same problem would happen if Swing
classes were used.

I have made a mistake in claiming that there is a Linux bug - a friend who
tested an applet used a 'paste' button and the Java Clipboard classes,
instead he used the middle-button paste to transfer text into a
java.awt.TextArea, which worked.  I apologise to the Linux developers!
However, my problem remains....

Reply via email to