Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11584

Listening to applet moved around

From simplicity <stella_pigeon@live.ca>
Newsgroups comp.lang.java.programmer
Subject Listening to applet moved around
Date 2012-01-23 10:24 -0800
Organization http://groups.google.com
Message-ID <e521d009-188f-4779-b193-ae7e849e33f5@v6g2000pba.googlegroups.com> (permalink)

Show all headers | View raw


Is there a way to detect the changes in screen location of the applet
as its parent browser is moved or resized?

I have the applet which start java.awt.Frame and places is directly on
top of the applet. I would like to be able to make this Frame follow
the applet location when the browser window is moved or resized. I got
the following working quite fine:

class OverlayWindow extends Frame implements MouseListener,
MouseMotionListener {
   ...
}

public class MyApplet extends Applet implements Runnable,
MouseListener, MouseMotionListener {
	OverlayWindow overlay;  // overlaying frame
        ...

       public void mouseMoved(MouseEvent e) {
            ...
           overlay.setLocation(this.getLocationOnScreen().x,
this.getLocationOnScreen().y);
       }
}

The problem is that the mouseMoved() kicks in only after the browser
window is moved and the cursor comes back into the area occupied by
the applet.

I would prefer to get the overlay frame follow the applet as it
changes the locations. I looked at WindowListener interface but do not
see anything related to changing the window location.

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Listening to applet moved around simplicity <stella_pigeon@live.ca> - 2012-01-23 10:24 -0800
  Re: Listening to applet moved around Roedy Green <see_website@mindprod.com.invalid> - 2012-01-24 01:36 -0800

csiph-web