Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Giving focus to JPanel when Down arrow is pressed from JButton

 
N Murali
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
I have four to five JButton in my frame. When i am clicking the first button, I dynamically displaying some JPanels. I have keyListener for the JButtons.
The focus is defaultly set to first button.
If i press Down Arrow i want to focus the first panel, at the same time i want to remove focus from the clicked JButton.

Give some ideas regarding this issue as soon as possible
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends, welcome to the JavaRanch.

First, if you have 5 buttons, I'm afraid that you implement all the GUI functionality. My spec only require me to provide GUI functionality to search and book only so I only had 2 buttons. May I know What assignment did you retrieve and the version ?

Second, I don't know the benefit to focus on JPanel. I didn't do that in my assignment.

Remember, simplicity is the key.

Good Luck !!! and Wish me luck too !!!

Jeffry Kristianto Yanuar (Java Instructor)
SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2) --> Waiting for the result
[ December 05, 2008: Message edited by: Jeffry Kristianto Yanuar ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic