Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Activating applet shortcut key in JSP page

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an applet in a jsp page. The applet has a button with a shortcut key. I want the button function to be activated when the shortcut key is pressed (NO MOUSE).

But now my mouse needs to click on the applet first and press the shortcut key.
I want a way to activate the button function with only the shortcut key. (NO MOUSE).

Any information is welcome. Please help...

Here is the code in my applet...



And here is the code in my jsp...
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think the problem is related to the Applet not having focus in the browser window.
Based on the the keyPressed() method, I assume you are using a KeyListener that you've added to the JButton instance, correct?
That mechanism only works if the Jbutton has focus. You should have a look at the the tutorial on How to Use Key Bindings.

 
Every plan is a little cooler if you have a blimp. And a tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic