File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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: 8836
    
    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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
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