On Wed, 25 Mar 2026 15:52:12 GMT, Christopher Schnick <[email protected]>
wrote:
> This fixes issues with Alerts when the owner stage is not a valid stage with
> a scene and currently showing
modules/javafx.controls/src/main/java/javafx/scene/control/HeavyweightDialog.java
line 55:
> 53: @Override public void centerOnScreen() {
> 54: Window owner = HeavyweightDialog.this.getOwner();
> 55: if (owner != null && owner.getScene() != null &&
> owner.isShowing() && (!(owner instanceof Stage ownerStage) ||
> !ownerStage.isIconified())) {
A test for the new condition: `owner.isShowing() && (!(owner instanceof Stage
ownerStage) || !ownerStage.isIconified())` would also be a good idea
modules/javafx.controls/src/main/java/javafx/scene/control/HeavyweightDialog.java
line 318:
> 316:
> 317: Scene oldScene = oldStage.getScene();
> 318: if (oldScene != null && scene != null && dialogScene !=
> null) {
A bit confused by the code. So, do we need to check `scene != null` here?
modules/javafx.controls/src/main/java/javafx/scene/control/HeavyweightDialog.java
line 330:
> 328:
> 329: Scene newScene = newStage.getScene();
> 330: if (newScene != null && scene != null && dialogScene !=
> null) {
Do we need to check `scene != null` here?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2127#discussion_r2989616636
PR Review Comment: https://git.openjdk.org/jfx/pull/2127#discussion_r2989610068
PR Review Comment: https://git.openjdk.org/jfx/pull/2127#discussion_r2989611499