File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 77import javafx .application .Platform ;
88import javafx .event .ActionEvent ;
99import javafx .event .EventHandler ;
10+ import javafx .geometry .Pos ;
1011import javafx .scene .Scene ;
1112import javafx .scene .control .Button ;
1213import javafx .scene .layout .StackPane ;
2223 */
2324
2425public class ScalePlayer extends Application {
25-
26+
2627 @ Override
2728 public void start (Stage primaryStage ) {
28- //
29+
2930 MenuBar menuBar = new MenuBar ();
3031 menuBar .prefWidthProperty ().bind (primaryStage .widthProperty ());
3132 Menu file = new Menu ("File" );
@@ -59,11 +60,15 @@ public void handle(ActionEvent event) {
5960 HBox hbox = new HBox ();
6061 hbox .getChildren ().addAll (playBtn , stopBtn );
6162 hbox .setSpacing (10 );
63+ hbox .setCenterShape (true );
64+ hbox .setAlignment (Pos .CENTER );
65+
6266
6367
6468 BorderPane root = new BorderPane ();
65- root . setCenter ( hbox );
69+
6670 root .setTop (menuBar );
71+ root .setCenter (hbox );
6772
6873
6974
You can’t perform that action at this time.
0 commit comments