Create a menu item and set its KeyStroke by name (so it can be stored in the language settings or the preferences. Syntax is here: https://docs.oracle.com/javase/8/docs/api/javax/swing/KeyStroke.html#getKeyStroke-java.lang.String- @param sequence the name, as outlined by the KeyStroke API @param fal
(String base)
| 161 | * @param fallback what to use if getKeyStroke() comes back null |
| 162 | */ |
| 163 | static public JMenuItem newJMenuItemExt(String base) { |
| 164 | JMenuItem menuItem = new JMenuItem(Language.text(base)); |
| 165 | KeyStroke ks = getKeyStrokeExt(base); // will print error if necessary |
| 166 | if (ks != null) { |
| 167 | menuItem.setAccelerator(ks); |
| 168 | } |
| 169 | return menuItem; |
| 170 | } |
| 171 | |
| 172 | |
| 173 | /** |
no test coverage detected