• Post Reply Bookmark Topic Watch Topic
  • New Topic

using mnemonics in Java Applet  RSS feed

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was trying to use setMnemonic method on one of my buttons in the applet, but the way the whole thing work is kind of strange. If use search.setMnemonic('s'); on my search button, the only way search is activated by pressing Alt+s is when I actually click inside an area of the applet. So if someone wants to use the applet, they have to first click somewhere inside the applet and then click Alt+s. It is somewhat akward don't you think? Is there a workaround?
thanks,
Alex
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mnemonics are only applicable within their application... if not, pressing Alt-F would always open the Microsoft word file menu... even if you were working in JBuilder. So Mnemonics only working in their focused window is a good thing. One thing that may help is to call requestFocus() in the start() method of your applet. It is not 100% foolproof, but should request focus on your applet when it starts up.

-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!