Re: Oh where did my MouseEvents go?

The DisplayListener did the trick.

Thanks,
Bruce


On Dec 22, 2004, at 4:23 AM, Bill Hibbard wrote:

Hi Bruce,

You can access many of the MouseEvents by adding a
visad.DisplayListener to your DisplayImplJ3D. See
visad.DisplayEvent for a list of event types.

Good luck,
Bill

On Tue, 21 Dec 2004, Bruce Flynn wrote:


I am trying to intercept MouseEvents from a JFrame containing a VisAD
graph by registering a MouseListener on the glass pane. The problem is
that I can't seem to get the glass pane to intercept the events with a
VisAD graph in the frame.  It does however work with other components.
After doing some investigating, using the example P2_01 code provided
by Ugo Taddei, it seems to only seems to malfunction with the
DisplayImplJ3D, which is what I'm using.  I can get the MouseEvents by
adding the below code, but not when I change the display to
DisplayImplJ3D.

     jframe.getGlassPane().addMouseListener( new MouseAdapter(){
         public void mouseClicked( MouseEvent evt ){
             System.out.println("MOUSE CLICKED");
         }
     });
     jframe.getGlassPane().setVisible(true);

Any idea how to get MouseEvents using DisplayImplJ3D?

I included both sources with P2_01.java containing the 3D display

Thanks
Bruce




  • 2004 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: