Hi,

I have noticed the following problem with exception handling and multiple JFXPanels (FX 2.2):

1. Two JFXPanels, J1 and J2
2. Throw NPE in layoutChildren of a control inside J1

This would print a stacktrace (see below). Then J2 is blocked: mouse clicks have no effect anymore. I think I have seen something similar with invalid FXML but did not check again now. On the other hand, if a button action-event handler throws an exception everything is fine: stacktrace is printed but the JFXPanels stay alive.

What is the deal here? When are exceptions "lethal", and what can I do to protect against this, preferably without adding a try..catch to each layoutChildren (and whereever else this might be needed)...

Werner

java.lang.NullPointerException: kaboom
        at 
mint.javafx.scene.layout.designerpane.MintDesignerPane.layoutChildren(MintDesignerPane.java:192)
        at javafx.scene.Parent.layout(Parent.java:1018)
        at javafx.scene.Parent.layout(Parent.java:1028)
        at javafx.scene.Scene.layoutDirtyRoots(Scene.java:513)
        at javafx.scene.Scene.doLayoutPass(Scene.java:484)
        at javafx.scene.Scene.access$3900(Scene.java:169)
        at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2199)
        at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:363)
        at 
com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
        at 
com.sun.javafx.tk.quantum.QuantumToolkit$9.run(QuantumToolkit.java:329)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at 
com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
        at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
        at java.lang.Thread.run(Unknown Source)

Reply via email to