Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Listening to applet moved around

Reply
Thread Tools

Listening to applet moved around

 
 
simplicity
Guest
Posts: n/a
 
      01-23-2012
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.

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      01-24-2012
On Mon, 23 Jan 2012 10:24:12 -0800 (PST), simplicity
<> wrote, quoted or indirectly quoted someone who
said :

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


see http://mindprod.com/jgloss/coordinates.html
--
Roedy Green Canadian Mind Products
http://mindprod.com
One of the most useful comments you can put in a program is
"If you change this, remember to change ?XXX? too".

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iframe reloads whenever it's moved around the DOM sammyleong@gmail.com Javascript 2 01-19-2006 12:22 AM
Read all of this to understand how it works. then check around on otherRead all of this to understand how it works. then check around on other thelisa martin Computer Support 2 08-18-2005 06:40 AM
Interruptions in live news listening Realone Player listening Thaqalain Computer Support 6 07-16-2005 02:11 PM
Pages getting moved around on server? UJ ASP .Net 0 05-19-2005 12:27 PM
Make wxListCtrl fit around contents and parent frame fit around listctrl Piet Python 0 07-18-2004 08:27 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57