By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,686 Members | 1,558 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,686 IT Pros & Developers. It's quick & easy.

KeyEvent

P: 8
Plz tell what is the use of making a panel set focusable
<p.setFocusable(true);>
while using key events is this necessary?
Jul 28 '07 #1
Share this Question
Share on Google+
1 Reply


blazedaces
100+
P: 284
Plz tell what is the use of making a panel set focusable
<p.setFocusable(true);>
while using key events is this necessary?
You just posted in the previous thread, but here's the link again to the tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/events/keylistener.html

Here's what I suggest, download the example and try NOT setting setFocusable(true) and see if it works. That will tell you simply if it is necessary. Beforehand it worked, if it doesn't work afterhand you know it's necessary. If it does, you know it's not...

-blazed
Jul 28 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.