diff --git a/enough-polish-j2me/source/src/de/enough/polish/ui/MenuBar.java b/enough-polish-j2me/source/src/de/enough/polish/ui/MenuBar.java index 8cedff8..4a828e2 100644 --- a/enough-polish-j2me/source/src/de/enough/polish/ui/MenuBar.java +++ b/enough-polish-j2me/source/src/de/enough/polish/ui/MenuBar.java @@ -1346,7 +1346,7 @@ protected boolean handleKeyPressed(int keyCode, int gameAction) { //#endif if (keyCode >= Canvas.KEY_NUM1 && keyCode <= Canvas.KEY_NUM9) { int index = keyCode - Canvas.KEY_NUM1; - if (index <= this.commandsContainer.size()) { + if (index < this.commandsContainer.size()) { CommandItem item = (CommandItem) this.commandsContainer.get(index); if (item.getAppearanceMode() != Item.PLAIN) { if (!item.isFocused) { @@ -1574,7 +1574,7 @@ protected boolean handleKeyReleased(int keyCode, int gameAction) { } else { if (keyCode >= Canvas.KEY_NUM1 && keyCode <= Canvas.KEY_NUM9) { int index = keyCode - Canvas.KEY_NUM1; - if (index <= this.commandsContainer.size()) { + if (index < this.commandsContainer.size()) { CommandItem item = (CommandItem) this.commandsContainer.get(index); if (item.getAppearanceMode() != Item.PLAIN) { if (!item.isFocused) {