Start HelloDialogs, tick "Use custom graphic".
Any dialog except custom dialogs will throw NPE:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at hello.HelloDialogs.configureSampleDialog(HelloDialogs.java:427)
at hello.HelloDialogs.lambda$start$7(HelloDialogs.java:224)
at hello.HelloDialogs$$Lambda$81/120593124.handle(Unknown Source)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
...
The reason is that it can't find "tick.png" in the classpath here:
dlg.getDialogPane().setGraphic(new ImageView(new Image(getClass().getResource("tick.png").toExternalForm())));
The fix is as simple as
dlg.getDialogPane().setGraphic(new ImageView(new Image(getClass().getResource("dialog/tick.png").toExternalForm())));
Any dialog except custom dialogs will throw NPE:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at hello.HelloDialogs.configureSampleDialog(HelloDialogs.java:427)
at hello.HelloDialogs.lambda$start$7(HelloDialogs.java:224)
at hello.HelloDialogs$$Lambda$81/120593124.handle(Unknown Source)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
...
The reason is that it can't find "tick.png" in the classpath here:
dlg.getDialogPane().setGraphic(new ImageView(new Image(getClass().getResource("tick.png").toExternalForm())));
The fix is as simple as
dlg.getDialogPane().setGraphic(new ImageView(new Image(getClass().getResource("dialog/tick.png").toExternalForm())));