JGoodies Form Layout (2024)

JGoodies FormLayout is a powerful, flexible and precise general purpose layout manager. It aligns components vertically and horizontally in a dynamic rectangular grid of cells, with each component occupying one or more cells. A whitepaper about the FormLayout available online. To use FormLayout you first define the grid by specifying the columns and rows. In a second step you add components to the grid. You can specify columns and rows via human-readable String descriptions or via arrays of ColumnSpec and RowSpec instances. Each component managed by a FormLayout is associated with an instance of CellConstraints. The constraints object specifies where a component should be located on the form's grid and how the component should be positioned. In addition to its constraints object the FormLayout also considers each component's minimum and preferred sizes in order to determine a component's size.

Note that JGoodies FormLayout support is only available in the Professional version of the product.
This layout also requires the use of the JGoodies FormLayout jar file (forms-1.0.6.jar or higher).

  • Main Features
  • Popup Header Menu
  • Graphical Feedback
  • Preferences

This feature is based on technology from the JGoodies Forms.
http://www.jgoodies.com/freeware/forms/
Copyright &copy 2002-2009 JGoodies Karsten Lentzsch

Main Features

  • Select JGoodies FormLayout from the Layouts palette and drop it on a JFrame or JPanel

JGoodies Form Layout (1)

  • The JGoodies FormLayout jar file (forms-1.1.0.jar) will automatically be added to your project and the classpath adjusted
  • Graphical feedback is provided for all column, row and cell interactions
  • Column and row properties may be changed via a popup menu or property dialog
  • Convert existing layouts (null, GridBagLayout, etc.) to JGoodies FormLayout with intelligent column, row and gap creation

JGoodies Form Layout (2)JGoodies Form Layout (3)

  • Automatically add gaps when adding new columns or rows

Popup Header Menu

  • Right-click on the header area to access the popup header menu
JGoodies Form Layout (4)JGoodies Form Layout (5)
  • Insert new columns or rows before the current column or row
  • Add a new column or row at the end of the current list
  • Delete entire columns or rows or just their widget contents
  • Set the column alignment to left, right, center or fill
  • Specify that the column or row should grow to fill the available space
  • Group or ungroup columns or rows
  • Set the sizing spec that should be used for the column or row (various column, row and gap types are available)
  • Edit the properties of the current column or row

Graphical Feedback

  • When moving a widget or adding a new widget, open cells are highlighted green while populated cells are highlighted red and insertion points are highlighted in yellow

    JGoodies Form Layout (6)JGoodies Form Layout (7)JGoodies Form Layout (8)

  • Phantom drop point to the right and below the current cells will create new columns, rows and gaps as needed

    JGoodies Form Layout (9)JGoodies Form Layout (10)

  • The currently selected cell shows its column and row spanning handles and alignment handles

    JGoodies Form Layout (11)

  • Set the alignment of a cell using its popup alignment menu or the toolbar

JGoodies Form Layout (12)

JGoodies Form Layout (13)JGoodies Form Layout (14)

  • Right-click on a column to set its grow property

JGoodies Form Layout (15)JGoodies Form Layout (16)

  • Grouped columns and rows are color highlighted to indicate which are in the same group

JGoodies Form Layout (17)JGoodies Form Layout (18)JGoodies Form Layout (19)

  • Column and row sizing handles make it easy to set the size of a column or row

JGoodies Form Layout (20)JGoodies Form Layout (21)

JGoodies Form Layout (22)JGoodies Form Layout (23)

  • Reorder columns and rows by dragging them (with their associated gap columns or rows)

JGoodies Form Layout (24)JGoodies Form Layout (25)JGoodies Form Layout (26)

  • Column and rows borders are indicated with gray lines

JGoodies Form Layout (27)

  • Interactive column and row spanning feedback is provided

JGoodies Form Layout (28)JGoodies Form Layout (29)

  • Full keyboard support for quickly changing alignment values
Cells
Ddefault horizontal
Shift+Ddefault vertical
Ffill horizontal
Shift+Ffill vertical
L, C, Rleft/center/right for horizontal
T, M, Btop/middle/bottom for vertical

Column & Row Editing

  • Double click on a column or row to access its property dialog
  • Switch between columns and rows using the arrow buttons
JGoodies Form Layout (30)JGoodies Form Layout (31)
  • Select from any of the predefined column or gap templates

JGoodies Form Layout (32)JGoodies Form Layout (33)

  • Set the column or row alignment
  • Specify the resize behavior and the relative weights of each column or row
  • Set the size of the column or row
    • Specify a constant size in a variety of units
    • Specify minimum and maximum sizes

JGoodies Form Layout (34)JGoodies Form Layout (35)

  • Floating layout assistant for constraintsJGoodies Form Layout (36)

JGoodies Form Layout (37)

  • Open the Columns or Rows editing dialog from the Property Pane or the right-click context menu of the panel.

JGoodies Form Layout (38)JGoodies Form Layout (39)

  • Insert or add new columns and rows
  • Open the property dialog for an individual column or row
  • Group and ungroup columns or rows
  • Rearrange the order of the columns or rows

JGoodies Form Layout (40)

JGoodies Form Layout (41)


Preferences

  • Control whether automatic grab is used for text widgets, comboboxes, tables, etc.

JGoodies Form Layout (42)JGoodies Form Layout (43)

  • Control whether labels are automatically right-aligned when next to a text widget

JGoodies Form Layout (44)JGoodies Form Layout (45)

Source Code Generation & Parsing

  • Intelligently convert existing layouts (null, GridBagLayout, etc.) to JGoodies FormLayout with column, row and gap creation
  • Generated code will use predefined FormFactory constants as necessary
  • Parser can understand reused CellConstraint objects
  • Parser supports all CellConstraint styles
    • Creation methods intended for use by humans
      CellConstraints cc = new CellConstraints();
      cc.xy(2, 1); // second col, first row
      cc.xy(2, 1, "right, bottom"); // aligned to right and bottom
      cc.xy(2, 1, "r, b"); // abbreviated alignment
      cc.xywh(2, 1, 4, 3); // spans 4 cols, 3 rows
      cc.xywh(2, 1, 4, 3, "right, bottom");
      cc.xywh(2, 1, 4, 3, "r, b");
    • Constructors intended for builders
      new CellConstraints(); // first col, first row
      new CellConstraints(2, 1);
      new CellConstraints(2, 1, 4, 3);
      new CellConstraints(2, 1, CellConstraints.RIGHT, CellConstraints.BOTTOM);
    • Constructors intended for building UIs from XML
      CellConstraints cc = new CellConstraints();
      new CellConstraints("2, 1");
      new CellConstraints("2, 1, r, b");
      new CellConstraints("2, 1, 4, 3");
      new CellConstraints("2, 1, 4, 3, r, b");

JGoodies Form Layout (46)

JGoodies Form Layout (2024)

References

Top Articles
Latest Posts
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 5450

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.