Skip to content

Commit 2ef1315

Browse files
hansonrhansonr
authored andcommitted
fix for mnemonic -1
1 parent 2d1c749 commit 2ef1315

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSComponentUI.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,13 +1235,13 @@ protected void setMnemonic(int newValue) {
12351235
if (newValue == mnemonic || domNode == null)
12361236
return;
12371237
if (newValue < 0) {
1238-
newValue = (isLabel ? (label == null ? 0 : label.getDisplayedMnemonic())
1239-
: /** @j2sNative this.jc.getMnemonic$ && this.jc.getMnemonic$() ||*/ 0);
1238+
newValue = (isLabel ? (label == null ? -1 : label.getDisplayedMnemonic())
1239+
: /** @j2sNative this.jc.getMnemonic$ && this.jc.getMnemonic$() ||*/ -1);
12401240
}
12411241
DOMNode node = (menuAnchorNode == null ? domNode : menuAnchorNode);
1242-
if (newValue != mnemonic)
1242+
if (mnemonic > 0 && newValue != mnemonic)
12431243
removeClass(node, "ui-mnem-" + Character.toLowerCase(mnemonic));
1244-
if (newValue != 0)
1244+
if (newValue > 0)
12451245
addClass(node, "ui-mnem-" + Character.toLowerCase(newValue));
12461246
mnemonic = newValue;
12471247
}

0 commit comments

Comments
 (0)