com.alee.utils.swing
Class WindowFollowAdapter
java.lang.Object
java.awt.event.ComponentAdapter
com.alee.utils.swing.WindowFollowAdapter
- All Implemented Interfaces:
- java.awt.event.ComponentListener, java.util.EventListener
public class WindowFollowAdapter
- extends java.awt.event.ComponentAdapter
This listener allows you to quickly attach one window to another window. This means that this window will always follow the other one
when it moves on the screen. Though the other window in this link will not follow this window as it moves.
- Author:
- Mikle Garin
Constructor Summary |
WindowFollowAdapter(java.awt.Window followingWindow,
java.awt.Window parentWindow)
|
Methods inherited from class java.awt.event.ComponentAdapter |
componentHidden, componentShown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
followingWindow
protected final java.awt.Window followingWindow
parentWindow
protected final java.awt.Window parentWindow
enabled
protected boolean enabled
lastLocation
protected java.awt.Point lastLocation
WindowFollowAdapter
public WindowFollowAdapter(java.awt.Window followingWindow,
java.awt.Window parentWindow)
isEnabled
public boolean isEnabled()
setEnabled
public void setEnabled(boolean enabled)
updateLastLocation
public void updateLastLocation()
getFollowingWindow
public java.awt.Window getFollowingWindow()
getParentWindow
public java.awt.Window getParentWindow()
componentResized
public void componentResized(java.awt.event.ComponentEvent e)
- Specified by:
componentResized
in interface java.awt.event.ComponentListener
- Overrides:
componentResized
in class java.awt.event.ComponentAdapter
componentMoved
public void componentMoved(java.awt.event.ComponentEvent e)
- Specified by:
componentMoved
in interface java.awt.event.ComponentListener
- Overrides:
componentMoved
in class java.awt.event.ComponentAdapter
install
public static WindowFollowAdapter install(java.awt.Window followingWindow,
java.awt.Window parentWindow)
uninstall
public static void uninstall(java.awt.Window parentWindow,
WindowFollowAdapter windowFollowAdapter)