O'Reilly logo

Java Swing, 2nd Edition by Brian Cole, James Elliott, Marc Loy, Robert Eckstein, Dave Wood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The DesktopManager Interface

This interface is responsible for much of the management of internal frames contained by JDesktopPanes. It allows an L&F to define exactly how it wants to manage things such as frame activation, movement, and iconification. Most of the methods in InternalFrameUI implementations should delegate to a DesktopManager object. As described earlier, DesktopManagers are contained by JDesktopPane objects and are intended to be set by the L&F. You can also create your own variations on the supplied implementations to provide custom behavior, as shown in the example that concludes this chapter.

Methods

The majority of the methods in this interface act on a given JInternalFrame. However, those methods that could be applied to other types of components do not restrict the parameter unnecessarily (they accept any JComponent), despite the fact that they are typically used only with JInternalFrames. If you implement your own DesktopManager or other L&F classes, you may find a need for this flexibility.

public abstract void activateFrame( JInternalFrame f )

Called to indicate that the specified frame should become active (is gaining focus).

public abstract void beginDraggingFrame( JComponent f )

Called to indicate that the specified frame is now being dragged. The given component is normally a JInternalFrame.

public abstract void beginResizingFrame( JComponent f, int direction)

Called to indicate that the specified frame will be resized. The direction comes from SwingConstants ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required