• Post Reply Bookmark Topic Watch Topic
  • New Topic

swing & keylistener problems  RSS feed

 
karl nilsson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've noticed that KeyListener for some reason does not work with a swing JApplet, but will work on an awt applet. I know the code is correct, because it works fine on the windows side

even this simple applet doesn't work:

the weird thing is, textboxes and other textual components work in swing. Is the problem my jre, or is it just that I'm doing something wrong?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've seen this kind of thing; I don't recall seeing specific documentation that explains it, but it is nonetheless true that despite the fact that what you have may work on some platforms, for it to work on all platforms, you need a call to setFocusable(true) on the JApplet.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!