Monday, May 21, 2012

JavaFX 2.0 Layouts: BorderPane

Here is the sixth tutorial in JavaFX 2.0 Layout series It's about BorderPane layout. The BorderPane layout pane provides five regions: top, bottom, left, right and center. Into this regions you can place your components and other layouts.  Image 1 shows the type of layout that you can create with a border pane. The regions can be any size. If your application does not need one of the regions, you do not need to define it and no space is allocated for it.


BorderPane
Image 1


This will be a short tutorial, because I'll explain only positioning buttons to BorderPane regions.  More logical and better used example of BorderPane would be if you place layouts to the regions and add components to that layouts. You can check the tutorial like that by clicking on this link: "Using Built-In Layout Panes"A border pane is useful for the classic look of a tool bar at the top, a status bar at the bottom, a navigation panel on the left, additional information on the right, and a working area in the center.



Here is the code of our VBox example.



Below you can look how our program will look in the end.
BorderPane example
BorderPane example

If you like this, and other JavaFX 2 tutorials on this blog, you can follow me on Twitter to be informed about new JavaFX tutorials.


Check other tutorials from JavaFX Layout series by clicking on the image below.
javafx 2 layout

0 comments:

Post a Comment