button1,button2,button3 を横に並べる
HBox{
translateX: 10
translateY: 10
spacing: 20
content:[button1,button2,button3]
}
translateX, translateY は HBox のゼロ点をずらす
spacing は各コンテンツの間隔
content は並べるコンテンツの Sequence
button1,button2,button3 を縦に並べる
VBox{
translateX: 10
translateY: 10
spacing: 20
content:[button1,button2,button3]
}
Stage で使うとこんな感じ
More...
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
Stage {
title: "Components"
width: 430
height: 300
visible: true
scene: Scene{
fill: Color.CORNSILK
content: VBox{
translateX: 10
translateY: 10
spacing: 20
content:[
HBox{
spacing: 50
content:[combobox, checkbox]
},
HBox{
spacing: 10
content:[
scrollpane,
VBox{
spacing: 50
content:[
VBox{
spacing: bind slider.value
content:[
radioButton1,
radioButton2,
radioButton3]
},
textField]
},
VBox{content:[
button1,
button2,
button3]
}
]
},
HBox {
spacing: 20
content:[label, slider]
}
]
} //VBox
}//Scene
}//Stage
0 件のコメント:
コメントを投稿