Advertisement

JavaFX按钮场景切换

阅读量:
复制代码
    package application;
    
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.layout.StackPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    
    
    public class SceneChange extends Application {
    Scene scene1,  scene2;
    
    public static void main(String[] args) {
        launch(args);
    }
    
    @Override
    public void start(Stage primaryStage) throws Exception {
        // 场景1
        Button button1 = new Button("场景1 的button");
    
        // 事件监听 点击后切换到场景

全部评论 (0)

还没有任何评论哟~