SmartVessel

Foucs on C++

博客园 首页 新随笔 联系 订阅 管理
    @FXML
    private void handleButtonAction(ActionEvent event) throws Exception {
        System.out.println("You clicked me!");
        label.setText("Hello World!");

        //aslo I want to show another scence

        //1.Get application stage
        Stage currentStage = (Stage) ((Node) event.getSource()).getScene().getWindow();
        //2.Create new scence from fxml
        Parent root = FXMLLoader.load(getClass().getResource("mainUI/mianUI.fxml"));

        Scene scene1 = new Scene(root);
        //3.Set new scence to the stage
        currentStage.setScene(scene1);
        //currentStage.show();
    }

 

posted on 2013-05-30 16:45  SmartVessel  阅读(300)  评论(0编辑  收藏  举报