• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
  • Tim Holloway
  • Carey Brown
  • salvin francis

using mnemonics in Java Applet

Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Posts: 4121
IntelliJ IDE Spring Java
  • 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.

World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
create, convert, edit or print DOC and DOCX in Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!