-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
8
-
8.0-graphics-scrum-b621-x64
The following sequence
KeyCodeCombinationBuilder.create().control(KeyCombination.ModifierValue.DOWN).code(KeyCode.DELETE).build();
throws the following exception:
java.lang.NullPointerException: Modifier value must not be null!
at javafx.scene.input.KeyCombination.<init>(KeyCombination.java:176)
at javafx.scene.input.KeyCodeCombination.<init>(KeyCodeCombination.java:65)
at javafx.scene.input.KeyCodeCombinationBuilder.build(KeyCodeCombinationBuilder.java:100)
at Bug2.start(Bug2.java:15)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:491)
at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:251)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:217)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(Unknown Source)
at com.sun.glass.ui.win.WinApplication$3$1.run(Unknown Source)
... 1 more
A workaround is to either set all modifiers explicitly which doesn't seem to be convenient:
KeyCodeCombinationBuilder.create()
.alt(KeyCombination.ModifierValue.UP)
.meta(KeyCombination.ModifierValue.UP)
.shift(KeyCombination.ModifierValue.UP)
.shortcut(KeyCombination.ModifierValue.UP)
.control(KeyCombination.ModifierValue.DOWN)
.code(KeyCode.DELETE)
.build();
or do not use builder at all:
new KeyCodeCombination(KeyCode.INSERT, KeyCombination.CONTROL_DOWN)
KeyCodeCombinationBuilder.create().control(KeyCombination.ModifierValue.DOWN).code(KeyCode.DELETE).build();
throws the following exception:
java.lang.NullPointerException: Modifier value must not be null!
at javafx.scene.input.KeyCombination.<init>(KeyCombination.java:176)
at javafx.scene.input.KeyCodeCombination.<init>(KeyCodeCombination.java:65)
at javafx.scene.input.KeyCodeCombinationBuilder.build(KeyCodeCombinationBuilder.java:100)
at Bug2.start(Bug2.java:15)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:491)
at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:251)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:217)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(Unknown Source)
at com.sun.glass.ui.win.WinApplication$3$1.run(Unknown Source)
... 1 more
A workaround is to either set all modifiers explicitly which doesn't seem to be convenient:
KeyCodeCombinationBuilder.create()
.alt(KeyCombination.ModifierValue.UP)
.meta(KeyCombination.ModifierValue.UP)
.shift(KeyCombination.ModifierValue.UP)
.shortcut(KeyCombination.ModifierValue.UP)
.control(KeyCombination.ModifierValue.DOWN)
.code(KeyCode.DELETE)
.build();
or do not use builder at all:
new KeyCodeCombination(KeyCode.INSERT, KeyCombination.CONTROL_DOWN)
- relates to
-
JDK-8122647 Cannot save/load a MenuItem with an accelerator
-
- Closed
-