From: dman <ds...@ri...> - 2001-12-19 00:09:05
|
On Tue, Dec 18, 2001 at 09:46:50AM +0100, Barry Gaunt wrote: | Hi, | Swing's JMenuItem has a constructor which takes a string and an int. ^^^ "A" is a string (or char), not an int. Try JMenuItem( "Argh!", ord("A") ). >>> java.lang.Character.getNumericValue( "A" ) 10 >>> java.lang.Character.getNumericValue( "B" ) 11 it looks to me like that java method is reading the character as a hex digit, but it goes beyond the base 16 limit. >>> java.lang.Character.getNumericValue( "F" ) 15 >>> java.lang.Character.getNumericValue( "G" ) 16 >>> java.lang.Character.getNumericValue( "H" ) 17 -D -- Contrary to popular belief, Unix is user friendly. It just happens to be selective about who it makes friends with. -- Dave Parnas |