private void loadFXML() { FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("EntryTask.fxml")); fxmlLoader.setRoot(this); fxmlLoader.setController(this); try { fxmlLoader.load(); } catch (IOException e) { // TODO 自動生成された catch ブロック e.printStackTrace(); } }
public InteractionsListController() { logger.entry(); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/customcontrol/InteractionsList.fxml")); fxmlLoader.setController(this); fxmlLoader.setRoot(this); try { fxmlLoader.load(); } catch (IOException ex) { logger.log(Level.FATAL, ex.getMessage(), ex); } logger.exit(); }
@Override public void start(Stage primaryStage) { try { TabPane page = (TabPane) FXMLLoader.load(Main.class.getResource("simple.fxml")); Scene scene = new Scene(page); primaryStage.setScene(scene); primaryStage.setTitle("Hotels"); primaryStage.show(); textf = (TextField) scene.lookup("#HotelNameTextb"); Button create = (Button) scene.lookup("#CreateButton"); create.setOnAction(this::handleButtonAction); } catch (Exception ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } }