• Post Reply Bookmark Topic Watch Topic
  • New Topic

Process key in applet.  RSS feed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an applet containing a JPanel. In Firefox sometimes if the applet is active but the JPanel and the applet itself do not get key events e.g. Esc key pressed. Is there a way to ensure that the applet gets the key? Thanks in advance.
 
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

vladislav peichev wrote:I have an applet containing a JPanel. In Firefox sometimes if the applet is active but the JPanel and the applet itself do not get key events e.g. Esc key pressed. Is there a way to ensure that the applet gets the key? Thanks in advance.


I think the applet consumes the events and does not dispatch them to its children. So try to catch the events from the JPanel instead.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!