Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
Use toolkit to get modifier for duplicate shortcut.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob van Mourik committed Aug 28, 2015
1 parent 8698fb8 commit 2a1f3fe
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.jvms.i18neditor;

import java.awt.Toolkit;

import javax.swing.JMenuItem;
import javax.swing.KeyStroke;

Expand All @@ -15,7 +17,7 @@ public class DuplicateTranslationMenuItem extends JMenuItem {

public DuplicateTranslationMenuItem(Editor editor, boolean enabled) {
super(MessageBundle.get("menu.edit.duplicate.title"));
setAccelerator(KeyStroke.getKeyStroke("ctrl D"));
setAccelerator(KeyStroke.getKeyStroke('D', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
addActionListener(e -> editor.duplicateSelectedTranslation());
setEnabled(enabled);
}
Expand Down

0 comments on commit 2a1f3fe

Please sign in to comment.