use of javafx.fxml.FXMLLoader in project PayFile by mikehearn.
the class GuiUtils method runAlert.
public static void runAlert(BiConsumer<Stage, AlertWindowController> setup) {
// JavaFX doesn't actually have a standard alert template. Instead the Scene Builder app will create FXML
// files for an alert window for you, and then you customise it as you see fit. I guess it makes sense in
// an odd sort of way.
Stage dialogStage = new Stage();
dialogStage.initModality(Modality.APPLICATION_MODAL);
FXMLLoader loader = new FXMLLoader(GuiUtils.class.getResource("alert.fxml"));
Pane pane = evalUnchecked(() -> (Pane) loader.load());
AlertWindowController controller = loader.getController();
setup.accept(dialogStage, controller);
dialogStage.setScene(new Scene(pane));
dialogStage.showAndWait();
}
use of javafx.fxml.FXMLLoader in project cryptomator by cryptomator.
the class AbstractFXMLViewController method createFxmlLoader.
/**
* Creates a FXML loader used in {@link #loadFxml()}. This method can be overwritten for further loader customization.
*
* @return Configured loader ready to load.
*/
protected FXMLLoader createFxmlLoader() {
final URL fxmlUrl = getFxmlResourceUrl();
final ResourceBundle rb = getFxmlResourceBundle();
final FXMLLoader loader = new FXMLLoader(fxmlUrl, rb);
loader.setController(this);
return loader;
}
use of javafx.fxml.FXMLLoader in project fxexperience2 by EricCanull.
the class AbstractWindow method root.
public Parent root() throws IOException {
FXMLLoader loader = new FXMLLoader(url(), bundle);
loader.setController(controller);
return loader.load();
}
use of javafx.fxml.FXMLLoader in project Smartcity-Smarthouse by TechnionYP5777.
the class SmartHouseApplication method createFXMLLoader.
public FXMLLoader createFXMLLoader(final String fxmlFileName) {
final URL url = getResource(fxmlFileName);
final FXMLLoader fxmlLoader = new FXMLLoader(url);
fxmlLoader.setClassLoader(getClass().getClassLoader());
log.info("Creating FXML for app \"" + getApplicationName() + "\" (" + getClass().getName() + ") from: " + url);
return fxmlLoader;
}
use of javafx.fxml.FXMLLoader in project Smartcity-Smarthouse by TechnionYP5777.
the class SimulatorController method initialize.
@Override
public void initialize(final URL location, final ResourceBundle __) {
FXMLLoader loader = new FXMLLoader(this.getClass().getResource("room_ui.fxml"));
tab1.setText("Bedroom");
try {
tab1.setContent((Node) loader.load());
} catch (final IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bedroom = loader.getController();
bedroom.setImageUrl("house.jpg").setLocation(Location.BEDROOM).setMainController(this);
// user tab:
loader = new FXMLLoader(this.getClass().getResource("room_ui.fxml"));
tab2.setText("Bathroom");
try {
tab2.setContent((Node) loader.load());
} catch (final IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bathroom = loader.getController();
bathroom.setImageUrl("house.jpg").setLocation(Location.BATHROOM).setMainController(this);
// user tab:
loader = new FXMLLoader(this.getClass().getResource("room_ui.fxml"));
tab3.setText("Kitchen");
try {
tab3.setContent((Node) loader.load());
} catch (final IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
kitchen = loader.getController();
kitchen.setImageUrl("house.jpg").setLocation(Location.KITCHEN).setMainController(this);
// user tab:
loader = new FXMLLoader(this.getClass().getResource("room_ui.fxml"));
tab4.setText("Livingroom");
try {
tab4.setContent((Node) loader.load());
} catch (final IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
livingroom = loader.getController();
livingroom.setImageUrl("house.jpg").setLocation(Location.LIVINGROOM).setMainController(this);
loadSensorList();
}
Aggregations