B4J v4.00 adds support for SplitPane container. SplitPane is a container made of two or more sections divided with movable dividers.
The SplitPane orientation is either horizontal or vertical.
You can combine multiple SplitPanes to achieve more complicated layouts.
Each section of the SplitPane is made of a layout file. This means that the layout will be split to multiple smaller layout files.
You should use anchors to allow the layouts to be resized when their section is resized.
Example project:
This layout is made of the following layout files:
- Main: Horizontal SplitPane with three sections and menu bar.
- LeftSide: The left ListView with the title.
- Center: The WebView with the TextField and Button.
- RightSide: Vertical SplitPane
- RightHistory / RightFavorites: The two lists.
You can limit the minimum and maximum sizes of each section by calling SplitPane.SetSizeLimits.
You can also get or sets the dividers positions with SplitPane.DividerPositions. It returns an array of doubles. Each value represent the position of a divider. The values are between 0 to 1.
The important point is to use anchors set to BOTH and designer script if necessary to create flexible layouts.
The SplitPane orientation is either horizontal or vertical.
You can combine multiple SplitPanes to achieve more complicated layouts.
Each section of the SplitPane is made of a layout file. This means that the layout will be split to multiple smaller layout files.
You should use anchors to allow the layouts to be resized when their section is resized.
Example project:
This layout is made of the following layout files:
- Main: Horizontal SplitPane with three sections and menu bar.
- LeftSide: The left ListView with the title.
- Center: The WebView with the TextField and Button.
- RightSide: Vertical SplitPane
- RightHistory / RightFavorites: The two lists.
You can limit the minimum and maximum sizes of each section by calling SplitPane.SetSizeLimits.
You can also get or sets the dividers positions with SplitPane.DividerPositions. It returns an array of doubles. Each value represent the position of a divider. The values are between 0 to 1.
The important point is to use anchors set to BOTH and designer script if necessary to create flexible layouts.