O'Reilly logo

JavaFX 2.0: Introduction by Example by Carl Dea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2-4. Manipulating Layout via Grids

Problem

You want to create a nice-looking form type user interface using grid type layout.

Solution

Create a simple form designer application to manipulate the user interface dynamically using the JavaFX’s javafx.scene.layout.GridPane. The form designer application will have the following features:

  • It will toggle the display of the Grid layout’s grid lines for debugging.
  • It will adjust the top padding of the GridPane.
  • It will adjust the left padding of the GridPane.
  • It will adjust the horizontal gap between cells in the GridPane.
  • It will adjust the vertical gap between cells in the GridPane.
  • It will align controls within cells horizontally.
  • It will align controls within cells vertically.

The following code ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required