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 Applets and the fly likes Activating applet shortcut key in JSP page 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 » Applets
Bookmark "Activating applet shortcut key in JSP page" Watch "Activating applet shortcut key in JSP page" New topic
Author

Activating applet shortcut key in JSP page

Daia Yum
Greenhorn

Joined: Mar 23, 2009
Posts: 19
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...


Daia
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1756
    
    7

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.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Activating applet shortcut key in JSP page
 
Similar Threads
not able to redirect to html file from a jsp
Question on using Ajax.Updater
I/O exception while reading: C:\-classpath..?
Problem to submit form using javascript in struts
Windows XP Popup blocking