JavaFX layout equivalent to GridLayout

I'm used to working with Swing to create GUIs, but for a recent project that I chose to switch to JavaFX. I'm having trouble recreating the specific layout that I used using GridLayout.

I need the following behavior: 2 columns whose size is proportional to the size of their parent, which centers their contents.

Using Swing, I would make a JPanel with a GridLayout (1 row, 2 columns) and add 2 JPanels with a BorderLayout, adding the actual content to these panels with a centered constraint. Then I could add the first panel to any container that has a layout that stretches with the frame, and everything will be fine.

I can't seem to recreate this behavior in JavaFX in a simple way. I can figure out how to do this using bindings and combining several panels, but I was hoping there was a layout that does this automatically. I tried using TilePane, HBox, GridPane, AnchorPane, SplitPane and even BorderPane, but none of them seem to do what I want.

Is there a recommended way to do this? I would prefer not to embed Swing in the application. Basically, I want to split the content into two columns, which are automatically stretched using Stage / Scene (JFrame).

+4
java layout javafx
source share