-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathLayoutLesson.java
More file actions
31 lines (27 loc) · 812 Bytes
/
Copy pathLayoutLesson.java
File metadata and controls
31 lines (27 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package fx;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
/**
* Created by max on 3/1/17.
*/
public class LayoutLesson extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
HBox hBox = new HBox();
hBox.getChildren().addAll(new Button("one"), new Button("two"));
hBox.setSpacing(5);
hBox.setPadding(new Insets(5));
Group root = new Group();
root.getChildren().addAll(hBox);
primaryStage.setScene(new Scene(root, 400, 300));
primaryStage.show();
}
}