This Java library is my take on a docking framework for Java Swing. There are many docking frameworks for Java Swing from back in the day, but none of them (that I'm aware of) are maintained and are complicated. Modern Docking was developed to be a far simpler docking framework to replace the usage of FlexDock. I'm open to suggestions if anyone has ideas to improve the framework.
Modern Docking binaries are available on Maven Central.
If you use Maven or Gradle, add a dependency with the following coordinates to your build script:
groupId: io.github.andrewauclair.ModernDocking
artifactId: ModernDocking
version: (see button below)
Otherwise download ModernDocking-<version>.jar
here:
Modern Docking snapshot binaries are available on
Sonatype OSSRH.
To access the latest snapshot, change the Modern Docking version in your dependencies
to <version>-SNAPSHOT
(e.g. 0.1.0-SNAPSHOT
) and add the repository
https://oss.sonatype.org/content/repositories/snapshots/
to your build (see
Maven
and
Gradle
docs).
- Docking Component Interface
- Docking Frames (Floating JFrame)
- Docking Ports (One per frame)
- Split Panels
- Tabbed Panels
- Visual Studio style drag floating and docking hints that show drop locations
- Requires FlatLaf L&F
Modern Docking UI binaries are available on Maven Central.
If you use Maven or Gradle, add a dependency with the following coordinates to your build script:
groupId: io.github.andrewauclair.ModernDocking
artifactId: ModernDockingUI
version: (see button below)
Otherwise download ModernDockingUI-<version>.jar
here:
See basic-demo for a simple example in Example.java and a more complicated example in MainFrame.java.
- dockable menu item
- min/max
When dragging a dockable hovering over another dockable will display docking handles in the center of the dockable. These handles provide easy access to dock to the North, South, East and West regions.
The dockable can also be docked to any of these regions by hovering over the region itself and dropping the dockable.
The root also has North, South, East and West handles to dock the dockable directly to the root of the panel.
Splits can be adjusted and perform continuous layout. Double clicking the split will return it to 50-50 split for the 2 sides.
Panels can be grouped into tabbed panes by dragging a dockable to the center region of another dockable.
Panels can be closed using the X button on their headers. This option can be disabled in the source code.
Panels can be floated as their own window by dragging them by their header and dropping them outside the frame. This creates a new JFrame with the dockable in it. More dockables can then be docked to this dockable.
Panels can be set to unpinned with View Mode > Unpinned from the settings button on the panel header. This option will display the panel on a side toolbar as a button which can be pressed to display the panel. Clicking outside the panel will return it to the toolbar. To pin the panel and return it to normal, select the View Mode > Pinned option.
Panels can be opened in their own window using View Mode > Window.
Display custom settings options on the settings menu.