Java Reference
In-Depth Information
Listing 5.14
Horizontal Box Layout
scene: Scene {
content: HBox {
spacing: 10
content : [
Rectangle {
width: 50
height: 20
fill: Color.NAVY
stroke: Color.YELLOW
},
Rectangle {
width: 40
height: 10
fill: Color.CORAL
stroke: Color.BLACK
},
Rectangle {
width: 30
height: 20
fill: Color.YELLOW
stroke: Color.BLACK
},
Rectangle {
width: 30
height: 20
fill: Color.RED
stroke: Color.YELLOW
},
]
This produces various rectangles horizontal to each other, as shown in Figure 5.8.
Figure 5.8
HBox Layout
Similarly, the Vertical Box ( VBox ) code is shown in Listing 5.15.
Listing 5.15
Vertical Box Layout
scene: Scene {
content: VBox {
spacing: 10
continues
 
Search WWH ::




Custom Search