ModernDocking 1.1 Help

Docking Programmatically

dock

The dock methods of the Docking class are used to dock dockables. There are several variations of this method that allow docking directly to a window or to specific regions of other dockables. There are variations that allow specifying the divider proportions to use for JSplitPanes and each form of dock allows using the persistentID directly or an instance of Dockable

dock(String persistentID, Window window)

Allows docking the dockable with persistentID to a given Window. This will only work if the root docking panel of the window is empty.

dock(Dockable dockable, Window window)

Allows docking the dockable to a given Window. This will only work if the root docking panel of the window is empty.

dock(String persistentID, Window window, DockingRegion region)

Docks the dockable with persistentID to the specified root region of the window. The divider proportion is set to .25.

dock(Dockable dockable, Window window, DockingRegion region)

Docks the dockable with persistentID to the specified root region of the window. The divider proportion is set to .25.

dock(String persistentID, Window window, DockingRegion, double dividerProportion)

dock(Dockable dockable, Window window, DockingRegion, double dividerProportion)

dock(String sourcePersistentID, String targetPersistentID, DockingRegion region)

dock(String sourcePersistentID, Dockable target, DockingRegion region)

dock(Dockable source, String targetPersistentID, DockingRegion region)

dock(Dockable source, Dockable target, DockingRegion region)

dock(String sourcePersistentID, String targetPersistentID, DockingRegion region, double dividerProportion)

dock(Dockable source, Dockable target, DockingRegion region, double dividerProportion)

    undock

    undock(String persistentID)

    Undocks the dockable with the persistentID. Nothing is done if the dockable is not docked

    undock(Dockable dockable

    Undocks dockable. Nothing is done if the dockable is not docked

      newWindow

      newWindow(Dockable dockable)

      Opens the dockable in a new `FloatingFrame` instance

      newWindow(String persistentID, Point location, Dimension size)

      Opens the dockable with persistentID in a new FloatingFrame at the given location with the given size

      newWindow(Dockable dockable, Point location, Dimension size)

      Opens the dockable in a new FloatingFrame at the given location with the given size

        bringToFront

        Brings the dockable to the front if it is not showing. If the dockable is in a tab group it will be made the active tab. If the dockable is hidden due to the Auto Hide feature, then it will be shown. Finally, the frame containing the dockable will be brought to the front with the JFrame::toFront function.

        A NotDockedException exception is thrown if the dockable is not docked.

        bringToFront(Dockable dockable)

        Call with an existing Dockable instance

        bringToFront(String persistentID)

        Call with the persistent ID of the dockable. Modern Docking will lookup the dockable. If not found, a DockableNotFoundException is thrown.

          display

          This method is a combination of dock and bringToFront. If the dockable is not docked it will be docked and then brought to the front

          display(Dockable dockable)

          display(String persistentID)

            isDocked

            Checks if a dockable is already docked

              isMaximized

              Checks if a dockable is currently maximized

                Last modified: 28 April 2025