|Hello and welcome back to JavaFX 2 Layouts tutorial series. This is a tutorial about TilePane. The TilePane layout pane places all of the nodes in a grid in which each cell, or tile, is the same size. Nodes can be laid out horizontally (in rows) or vertically (in columns). Gap properties can be set to manage the spacing between the rows and columns. The padding property can be set to manage the distance between the nodes and the edges of the pane. Below you can take a look how our example will look in the end.|
Here is the code:
We could modify a little bit our example by using the
prefRowsproperties to establish the preferred size of the tile pane. Below you can take a look how our example will look after using prefColumns properties.
If you want, you can check other tutorials from JavaFX 2 Layouts series: