Fx-Fast-Watch/src/main/java/at/ionas999/solution/App.java
Jonas Hinterdorfer 917cfcab8a added basic
2025-03-19 18:54:52 +01:00

39 lines
908 B
Java
Executable File

package at.ionas999.solution;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
/**
* JavaFX App
*/
public class App extends Application {
private static Scene scene;
@Override
public void start(Stage stage) throws IOException {
scene = new Scene(loadFXML("fastwatch"), 640, 410);
stage.setScene(scene);
stage.setTitle("Fast Watch");
stage.show();
}
static void setRoot(String fxml) throws IOException {
scene.setRoot(loadFXML(fxml));
}
private static Parent loadFXML(String fxml) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml"));
return fxmlLoader.load();
}
public static void main(String[] args) {
launch();
}
}