I would like to be able to detect a JInternalFrame's movement so that I can sync the movement of two frames. InternalFrameListner does not seem to be notified when an internalframe is moved to another place. Right now I'm thinking that I'll need to detect a click and drag on the JInternalFrame, then ask it for its location, then set the location of the other frame. Am I missing something? Is there a simpler way to do this? Thanks, Michael Crutcher
You could track movement on a javax.swing.JInternalFrame using java.awt.event.ComponentListener. Add your listener to the JInternalFrame's listener queue using JInternalFrame.addComponentListener(ComponentListener) and listen for the ComponentEvent from ComponentListener.componentMoved(ComponentEvent). Then use ComponentEvent.getSource() to retrieve a reference to the JInternalFrame that moved and check for its location.
A little example should get you on your way!
[ July 19, 2002: Message edited by: saager mhatre ]