场景编辑器 Scene Building


FXML场景布局文件可以帮助我们布局窗口,我们还可以借助场景编辑器来简化FXML代码的编写。
场景编辑器有独立的第三方的,也可以使用Oracle提供的。

使用场景编辑器编辑完成生成的fxml文件,需要在入口函数中引入进来。
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader. load (getClass().getResource( "sample.fxml" ));

Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
}

猜你喜欢

转载自blog.csdn.net/zhangxingyu126/article/details/80529554