# JavaFX

# 概述

img.png

# Hello World

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

public class Main extends Application {

    public static void main(String[] args) {
        launch();
    }

    @Override
    public void start(Stage stage) throws Exception {
        //舞台
        stage.setTitle("Hello World");

        //布局
        HBox hBox = new HBox();
        //控件
        Button button = new Button("按钮");
        hBox.getChildren().add(button);
        //场景
        Scene scene = new Scene(hBox, 500, 500);
        //展示舞台
        stage.setScene(scene);
        stage.show();
    }

}