In a Swing app, do the following in order:
1. Call Platform.setImplicitExit(false);
2. Create and show one or more panels
3. After the last window is disposed, call Platform.setImplicitExit(true);
Note that the FX Platform continues to run. This is because the JFXPanel code removes the finishListener after the last FX window is disposed, and the state of the implicitExit flag at that time determines whether it will call Platform.exit implcitly. The state of the flag is not read again.
This is a corner case and not worth fixing as part of the initial implementation of implcitExit since it complicates the logic. It is not expected that applications will toggle the setting of implicitExit, but if a use case presents itself, this bug could be fixed.
1. Call Platform.setImplicitExit(false);
2. Create and show one or more panels
3. After the last window is disposed, call Platform.setImplicitExit(true);
Note that the FX Platform continues to run. This is because the JFXPanel code removes the finishListener after the last FX window is disposed, and the state of the implicitExit flag at that time determines whether it will call Platform.exit implcitly. The state of the flag is not read again.
This is a corner case and not worth fixing as part of the initial implementation of implcitExit since it complicates the logic. It is not expected that applications will toggle the setting of implicitExit, but if a use case presents itself, this bug could be fixed.