This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes setMnemonic using a sting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "setMnemonic using a sting" Watch "setMnemonic using a sting" New topic
Author

setMnemonic using a sting

Craig Parsons
Ranch Hand

Joined: Jan 28, 2004
Posts: 40
I know to use the setMnemonic I type
button.setMnemonic('B');
but what if I have have an array of buttons labeled 1 thru 9. How can I use setMnemonic to give each of them a numbered hot key (1 - 9) without having to set each button individually.

Thanks,
Craig
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

String.valueOf(sub)
Integer.toString(sub)
""+sub
[ January 30, 2004: Message edited by: Joe Ess ]

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
jQuery in Action, 2nd edition
 
subject: setMnemonic using a sting
 
Similar Threads
using mnemonics in Java Applet
Understanding this Array?
key listeners for dynamically created buttons
controlling the buttons functions in a page using keyboard itself
button mnemonic