📜  javafx fxml 加载器示例 - 汇编代码示例

📅  最后修改于: 2022-03-11 14:48:10.130000             🧑  作者: Mango

代码示例1
@Override
public void start(Stage stage) throws IOException {

  // set up the scene
  FXMLLoader loader = new FXMLLoader(getClass().getResource("/orbit_the_camera_around_an_object/main.fxml"));
  Parent root = loader.load();
  controller = loader.getController();
  Scene scene = new Scene(root);

  // set up the stage
  stage.setTitle("Orbit the Camera Around an Object Sample");
  stage.setWidth(800);
  stage.setHeight(700);
  stage.setScene(scene);
  stage.show();
}