Added more logging and added modules.

This commit is contained in:
Konrad Neitzel 2023-03-09 21:44:18 +01:00
parent 6a24bf5979
commit 08f95c3732
2 changed files with 16 additions and 15 deletions

View File

@ -362,6 +362,8 @@
</modulepath> </modulepath>
<addmodules> <addmodules>
<addmodule>javafx.controls</addmodule> <addmodule>javafx.controls</addmodule>
<addmodule>javafx.graphics</addmodule>
<addmodule>javafx.fxml</addmodule>
</addmodules> </addmodules>
<mainclass>${main.class}</mainclass> <mainclass>${main.class}</mainclass>
<input>${project.build.directory}/modules</input> <input>${project.build.directory}/modules</input>

View File

@ -19,24 +19,23 @@ public class JavaFXApp extends Application {
@Override @Override
public void start(Stage primaryStage) throws IOException { public void start(Stage primaryStage) throws IOException {
try {
primaryStage.setTitle("Hello World!"); primaryStage.setTitle("Hello World!");
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MainWindow.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MainWindow.fxml"));
Parent root = fxmlLoader.load(); Parent root = fxmlLoader.load();
primaryStage.setScene(new Scene(root)); primaryStage.setScene(new Scene(root));
primaryStage.show(); primaryStage.show();
/* } catch (Exception ex) {
Button btn = new Button(); logger.error("Exception!", ex);
btn.setText("Say 'Hello World'"); }
btn.setOnAction(e -> System.out.println("Hello World!"));
StackPane root = new StackPane();
root.getChildren().add(btn);
*/
} }
public static void main(String[] args) { public static void main(String[] args) {
logger.warn("Starting ..."); logger.warn("Starting ...");
launch(args); try {
launch(args);
} catch (Exception ex) {
logger.error("Exception!", ex);
}
} }
} }