-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
8, jfx26
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Windows 11 Professionnel 24H2.
BellSoft Liberica JDK :
openjdk 24.0.2 2025-07-15
OpenJDK Runtime Environment (build 24.0.2+12)
OpenJDK 64-Bit Server VM (build 24.0.2+12, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
JavaFX completly freeze each time than user click to open the specific popup to edit custom color on a color picker component.
On simple hierarchy like that pane contenains a color picker, user can select colo picker that like a combo open a color chooser, at the bottom of the color choose a specific link purpose to open a new popup to personnalize custom color define in color chooser. This pop up always display correctly in standard graphics hierarchy.
But in the specific case mention below the component crash and display the fellowing stacktrace, application tottally freeze and can't be close or any other interaction with it.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Like define in code below, in a JavaFX stage, add a MenuButton component on it add a CustomMenuItem and add a color picker component on it. With this hierarchy click on edit custom color link crash application.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Open the custom color pup up to edit color.
ACTUAL -
Totally freeze cause by this error :
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "com.sun.javafx.tk.TKStage.setImportant(boolean)" because "peer" is null
at javafx.graphics/javafx.stage.Stage.doVisibleChanged(Stage.java:1182)
at javafx.graphics/javafx.stage.Stage$1.doVisibleChanged(Stage.java:190)
at javafx.graphics/com.sun.javafx.stage.StageHelper.visibleChangedImpl(StageHelper.java:63)
at javafx.graphics/com.sun.javafx.stage.WindowHelper.visibleChanged(WindowHelper.java:77)
at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1212)
at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1239)
at javafx.graphics/javafx.stage.Window.show(Window.java:1254)
at javafx.graphics/javafx.stage.Stage.show(Stage.java:277)
at javafx.controls/com.sun.javafx.scene.control.CustomColorDialog.show(CustomColorDialog.java:198)
at javafx.controls/javafx.scene.control.skin.ColorPalette$1.handle(ColorPalette.java:133)
at javafx.controls/javafx.scene.control.skin.ColorPalette$1.handle(ColorPalette.java:111)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8875)
at javafx.controls/javafx.scene.control.Hyperlink.fire(Hyperlink.java:156)
at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:937)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
at java.base/java.lang.Thread.run(Thread.java:1583)
---------- BEGIN SOURCE ----------
package fr.projetlineaire.phasemanager.utils;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ColorPicker;
import javafx.scene.control.CustomMenuItem;
import javafx.scene.control.MenuButton;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class MenuColorPickerBugDemo extends Application {
@Override
public void start(Stage stage) {
ColorPicker colorPicker = new ColorPicker();
CustomMenuItem customItem = new CustomMenuItem(colorPicker, false);
MenuButton menuButton = new MenuButton("Couleur");
menuButton.getItems().add(customItem);
VBox root = new VBox(menuButton);
Scene scene = new Scene(root, 320, 200);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
Windows 11 Professionnel 24H2.
BellSoft Liberica JDK :
openjdk 24.0.2 2025-07-15
OpenJDK Runtime Environment (build 24.0.2+12)
OpenJDK 64-Bit Server VM (build 24.0.2+12, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
JavaFX completly freeze each time than user click to open the specific popup to edit custom color on a color picker component.
On simple hierarchy like that pane contenains a color picker, user can select colo picker that like a combo open a color chooser, at the bottom of the color choose a specific link purpose to open a new popup to personnalize custom color define in color chooser. This pop up always display correctly in standard graphics hierarchy.
But in the specific case mention below the component crash and display the fellowing stacktrace, application tottally freeze and can't be close or any other interaction with it.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Like define in code below, in a JavaFX stage, add a MenuButton component on it add a CustomMenuItem and add a color picker component on it. With this hierarchy click on edit custom color link crash application.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Open the custom color pup up to edit color.
ACTUAL -
Totally freeze cause by this error :
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "com.sun.javafx.tk.TKStage.setImportant(boolean)" because "peer" is null
at javafx.graphics/javafx.stage.Stage.doVisibleChanged(Stage.java:1182)
at javafx.graphics/javafx.stage.Stage$1.doVisibleChanged(Stage.java:190)
at javafx.graphics/com.sun.javafx.stage.StageHelper.visibleChangedImpl(StageHelper.java:63)
at javafx.graphics/com.sun.javafx.stage.WindowHelper.visibleChanged(WindowHelper.java:77)
at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1212)
at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1239)
at javafx.graphics/javafx.stage.Window.show(Window.java:1254)
at javafx.graphics/javafx.stage.Stage.show(Stage.java:277)
at javafx.controls/com.sun.javafx.scene.control.CustomColorDialog.show(CustomColorDialog.java:198)
at javafx.controls/javafx.scene.control.skin.ColorPalette$1.handle(ColorPalette.java:133)
at javafx.controls/javafx.scene.control.skin.ColorPalette$1.handle(ColorPalette.java:111)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8875)
at javafx.controls/javafx.scene.control.Hyperlink.fire(Hyperlink.java:156)
at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:937)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
at java.base/java.lang.Thread.run(Thread.java:1583)
---------- BEGIN SOURCE ----------
package fr.projetlineaire.phasemanager.utils;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ColorPicker;
import javafx.scene.control.CustomMenuItem;
import javafx.scene.control.MenuButton;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class MenuColorPickerBugDemo extends Application {
@Override
public void start(Stage stage) {
ColorPicker colorPicker = new ColorPicker();
CustomMenuItem customItem = new CustomMenuItem(colorPicker, false);
MenuButton menuButton = new MenuButton("Couleur");
menuButton.getItems().add(customItem);
VBox root = new VBox(menuButton);
Scene scene = new Scene(root, 320, 200);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8175803 ColorPicker inside ContextMenu throws NPE when clicking on 'Custom Color...'
-
- Open
-