This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tab button  RSS feed

 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using actionPreformed(ActionEvent e) to trap when the Enter button is pressed from a JTextField. I would also like to catch the pressing of the tab button. Is there a FocusEvent ?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nigel,
Yes there is. The caveat is that you find out about it after the window system has completed the function:
FocusListener -->
FocusGained
FocusLost
Keep this in mind, and you will have no problems.
Regards,
Manfred.
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Manfred. I was being lazy and didn't look up the FocusListener in the Docs. However, I am finding that my validation code is becoming massive is there a good design pattern for GUI validation?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!