• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is focusable?

 
Nikos kat
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im not sure what this means in the component class
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whether the component can be the focus owner, generally for keyboard input.

e.g. a 'Snake' game, displayed on a JPanel, where the snake follows the
up/down/left/right arrow keys, will not work because the default 'focusable'
is false. Add 'panel.setFocusable(true)' and it works.
 
Nikos kat
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks vey much for your help
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!