The component level
As mentioned in the previous article, there are scenes below the form, scenes below the distribution of the office, and controls inside the layout.
First, an Application may have many forms, such as pop-up boxes, new Windows, and so on. Under the form is divided into scenes, we can set different scenes to the form to achieve the purpose of switching scenes. The form is divided into layout, layout is also a kind of Node Node, layout can be put into various controls. The logical structure is as follows:
The Node class diagram looks like this:
JavaFX coordinates
The JavaFX coordinates are calculated from the top left corner, (0,0), to the right is the positive X axis, and to the bottom is the positive Y axis. For example, the coordinates of a point in the bottom right corner are (10,20), which means that the point is 10 pixels to the right of the form and 20 pixels to the bottom.
Group: generic container
JavaFX Group does not have any layout style, but is a generic component container that displays all components in a single Group.
Regional Region
Region refers to a display Region. Its class inheritance relationship is as follows:
Region has several important concepts:
- Content Area: Indicates the Area for displaying Content
- Padding: Displays the distance between the area and the border
- Border: Border position of Region
- Margin: The Margin by which the border extends outward
The layout Pane
A layout is really a container that can hold other layouts or components. A layout, as its name implies, is a container generated for page layout. Layouts inherit from the Pane class, and the commonly used ones are as follows.
- Horizontal layout HBox: Horizontal layout HBox is a horizontal layout of components in the HBox.
- Vertical Layout VBox: Vertical layout is the placement of components vertically.
- FlowPane: Arrange vertically or horizontally, proceed to the next row or column at the end
- BorderPane: Provides five areas for placing controls, left, right, up, down, and in the middle.
- .
Controls the Control
Control is some components that can be manipulated, is some basic display unit, common including Button Button, single box, check box and so on. Controls inherit from the Control class, and different controls have different features.
Other common
Others include things like menus, shapes, etc., which readers can explore on their own.