Menu

#14 Java 1.5 may have broken getKeyStroke(char)

open
nobody
None
5
2005-01-31
2005-01-31
No

new Shortcut('q') no longer works, because the
constructors have been changed in Java 1.5. Changing
the code in Shortcut(char, modifiers) to use
getKeyStroke(new Character(c)...) is a partial fix, but
even then I can't get the menu item to actually work.

Discussion

  • Peter Seebach

    Peter Seebach - 2005-02-01

    Logged In: YES
    user_id=964484

    Comments: Going back to Java 1.4 seems to fix this... But I
    also note that all my testing under 1.5 involved new
    Shortcut('n') instead of new Shortcut('N'). So I will have
    to retry it; the "new Character" thing may have been a
    mistake anyway.

     
  • Peter Eastman

    Peter Eastman - 2005-04-09

    Logged In: YES
    user_id=74743

    I agree that "new Character(c)" looks like the correct thing to do.
    Unfortunately, it doesn't work. I don't know why, but I suspect it may be a
    Swing bug. I'll investigate further, but for the moment I'm leaving this as
    is, since it at least works with upper case letters.