From: Jim Trampolining.c. at D. <ji...@tr...> - 2001-12-18 17:04:51
|
Does this help ?: >>> upper=String("A") >>> upperNum=u.getBytes()[0] >>> upperNum 65 >>> lower=String("a") >>> lowerNum=lower.getBytes()[0] >>> lowerNum 97 >>> type(lowerNum) <jclass org.python.core.PyInteger at 7320312> >>> >12/18/2001 12:46:50 AM, Barry Gaunt <bar...@cs...> wrote: > >Hi, > Swing's JMenuItem has a constructor which takes a string and an int. >It can be used like this: JMenuItem("Argh!", "A") where the "A" is a shortcut character. > >I have tried to do this in jpython like this: > >from java.lang import * >shortcutChar = Character.getNumericValue(String("A").charAt(0)) >jmi = JMenuItem("Argh!", shortcutChar) > >The values returned in shortcutChar are wrong, for example "A" and "a" both give >the value 10. > >Any one knows what's up? > >I have tried plain: jmi=JMenuItem("Argh!", "A") but that gets rejected. > >Thanks >-Barry > > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users > _____________________ __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸`-' `-' "Programming is not communicating with the computer, it is communicating with the programmer who comes after you". - Code Complete |