Station layout properties


I’m using the docking frames core library, and I want to specify an initial width for the station. I already attached 2 images (expected and current result). Any help to be able to have an output as the expected?

Could you please give me an example on how to read/ write layout properties?


The easiest way to set the locations and sizes of a set of Dockables is to use a SplitDockGrid as in the code below.

The other method is to use “drop( Dockable, DockableProperty)” where you simulate a user dropping one Dockable after the other onto the station. The DockableProperty should be of type “SplitDockProperty” and tells the station where the “user” is dropping the new element.

import bibliothek.gui.DockController;
import bibliothek.gui.dock.DefaultDockable;
import bibliothek.gui.dock.SplitDockStation;
import bibliothek.gui.dock.station.split.SplitDockGrid;

public class Dock1 {
    public static void main( String[] args ){
    	JFrame frame = new JFrame();
        // setup a controller and a few dockables

        DockController controller = new DockController();
        SplitDockStation center = new SplitDockStation();
        controller.add( center );
        frame.add( center.getComponent() );
        SplitDockGrid grid = new SplitDockGrid();
        grid.addDockable( 0, 0, 25, 75, new DefaultDockable( "a" ) );
        grid.addDockable( 25, 0, 75, 75, new DefaultDockable( "b" ) );
        grid.addDockable( 0, 75, 100, 25, new DefaultDockable( "c" ) );
        center.dropTree( grid.toTree() );
        frame.setBounds( 20, 20, 500, 300 );
        frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        frame.setVisible( true );