Introducing the features of JavaFX SceneBuilder container

Introduction

This article is the 17th day article of SLP KBIT Advent Calendar 2018.

This article introduces a container that I wasn't sure about when I started using JavaFX and SceneBuilder. There are many people who are touching Java in the circle these days, so I hope it will help you when creating GUI applications.

What is a container?

The one in this area. containers.png It is the basis for arranging objects such as buttons. It is also possible to place the container inside the container, and it is possible to create a more complicated layout by combining them.

Overview of each container

Pane The simplest container. You can place the object anywhere you like.

AnchorPane You can fix the distance from the frame of AnchorPane to the objects installed in it.

Prepare a button that is anchored in the right frame of AnchorPane and a button that is not anchored anywhere. In this state, if you enlarge the screen size to the right, AnchorBefore.png AnchorAfter.png In this way, the anchored button moves at a distance from the right frame.

VBox VBox arranges objects vertically from the top side by side. It is possible to match the width of the object to the width of VBox, and you can make detailed settings when the screen size is changed. You can make the layout easier to see by setting the size and margins for each object. VBox.png

HBox HBox arranges objects horizontally from left to VBox. It basically works the same as VBox. HBox.png

FlowPane FlowPane lays out objects horizontally like HBox, but arranges them so that they wrap when they come to the far right. Like VBox, it can be laid out vertically.

BorderPane BorderPane places objects in the top, left, right, bottom, and center positions. Objects placed one above the other will be resized to their priority height, expanding the width of the BorderPane. Objects placed on the left and right are resized to their priority width and their vertical length is extended. Centered objects are resized to fill the entire available space in the center. Only one object can be placed in each location. If you want to place multiple objects, you need to place another container. Border.png

GridPane GridPane places objects in squares consisting of rows and columns. It is also possible to place it across multiple squares. Grid.png

in conclusion

This time, I introduced a container for arranging objects. However, there are other containers as well. Also, if I have a chance, I would like to explain in more detail how to use it and introduce other containers.

Recommended Posts

Introducing the features of JavaFX SceneBuilder container
The story of updating SonarQube's Docker Container
What are the updated features of java 13
The process of introducing Vuetify to Rails
Introducing the library
The story of introducing Ajax communication to ruby
Change the timezone of the https-portal container to JST
I touched on the new features of Java 15
Change the location folder of Docker image & container
JavaFX --Match the size of ImageView with other nodes
Predicted Features of Java
The world of clara-rules (2)
Automatically start the container
Judgment of the calendar
The world of clara-rules (4)
The world of clara-rules (1)
The world of clara-rules (3)
Features of Static variables
The world of clara-rules (5)
The idea of quicksort
[Java] Three features of Java
The idea of jQuery
The story of managing session information by introducing gem Redis
Nginx container that displays the Hostname of the host running Docker
Let's grasp the operation image (atmosphere) of the DI container of Spring
Get only the ID of the container specified by docker ps
The story of dieting the container of the Elixir application as much as possible