Layout Managers

Layout managers are an essential part of Swing forms. They lay out components within a container. JFormDesigner provides support for following layout managers:

How to choose a layout manager?

For "normal" forms use either one of the grid-based layout managers (FormLayout, TableLayout or GridBagLayout) or use "Free Design" (GroupLayout). Each layout manager has its advantages and disadvantages. FormLayout and TableLayout are open source and require that you ship an additional library with your application.

For button bars use FormLayout, TableLayout, GridBagLayout or FlowLayout.

To layout a main window, use BorderLayout. Place the toolbar to the north, the status bar to the south and the content to the center.

For toolbars use JToolBar, which has its own layout manager (based on BoxLayout).

For radio button groups, BoxLayout may be a good choice. Mainly because JRadioButton has a gap between its text and its border and therefore the gaps provided by FormLayout, TableLayout and GridBagLayout are not necessary.

Change layout manager

You can change the layout manager at any time. Either in the Properties view or by right-clicking on a container in the Design or Structure view and selecting the new layout manager from the popup menu.