Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Which high level control can accept key input event?  RSS feed

 
Nigel Chou
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I only know Canvas can accept key input events. But Canvas is a low level control.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The addKEyListener method is implemented by Component, so everything that extends from Component can accept key input.
 
Nigel Chou
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
The addKEyListener method is implemented by Component, so everything that extends from Component can accept key input.


Sorry, I mean in J2ME. J2ME does not have Component.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D'oh! I missed the J2ME part. Aren't there javadocs for J2ME which answer this question in the same way I found the answer for J2SE?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!