Skip to content

Commit

Permalink
workaround fix the menuitem underscore problem
Browse files Browse the repository at this point in the history
workaround fix for
#1

So the problem now is that the default value for
mnemonicParsingProperty is true.
  • Loading branch information
isghe committed Jun 3, 2020
1 parent 706ecbe commit 5114854
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions MenuBar_1.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public void handle(ActionEvent e)
};

for (MenuItem menuItem: menuItems){
menuItem.setMnemonicParsing (false); // to avoid underscore problem
m.getItems().add(menuItem);
menuItem.setOnAction (event);
}
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ On `Linux`:

![jfx-menuitem-problem-linux.png](images/jfx-menuitem-problem-linux.png)

The `underscore` problem can be resolved setting the `MenuItem.mnemonicParsingProperty` to `false`:

```
menuItem.setMnemonicParsing (false); // to avoid underscore problem
```

0 comments on commit 5114854

Please sign in to comment.