-
Bug
-
Resolution: Unresolved
-
P4
-
8
-
jdk1.8.0b76
Context menu key had the behavior similar to right-click but now there is no reaction.
To reproduce: right-click on the button. Context menu will appear. This will be the expected result.
Then push Context menu button and nothing will happen.
public class MenuItemTest extends Application {
@Override
public void start(Stage primaryStage) {
Parent root = createScene();
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle(VersionInfo.getRuntimeVersion());
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
private Parent createScene() {
ContextMenu menu = new ContextMenu();
for (int i = 0; i < 10; i++) {
MenuItem menuItem = new MenuItem("Item - 0x1" + i);
menu.getItems().add(menuItem);
}
Button btn = new Button("Button");
btn.setContextMenu(menu);
HBox root = new HBox(5);
root.getChildren().add(btn);
return root;
}
}
To reproduce: right-click on the button. Context menu will appear. This will be the expected result.
Then push Context menu button and nothing will happen.
public class MenuItemTest extends Application {
@Override
public void start(Stage primaryStage) {
Parent root = createScene();
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle(VersionInfo.getRuntimeVersion());
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
private Parent createScene() {
ContextMenu menu = new ContextMenu();
for (int i = 0; i < 10; i++) {
MenuItem menuItem = new MenuItem("Item - 0x1" + i);
menu.getItems().add(menuItem);
}
Button btn = new Button("Button");
btn.setContextMenu(menu);
HBox root = new HBox(5);
root.getChildren().add(btn);
return root;
}
}