This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Is it possible to do this Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Is it possible to do this" Watch "Is it possible to do this" New topic
Author

Is it possible to do this

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
I have several JTextfields which need to be populated.These
amounts in the end need to be calculated, the way I have things now the user needs to press enter at the end of filling each field; Is there some way to listen to when the user has left one textfield and gone on to the next.
thanks 4 all your time
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Yes... look into the FocusListener class... it supports the focusLost(FocusEvent) and focusGained(FocusEvent) methods. You will be interested in focusLost(). Just add a FocusListener to each textfield, and you'll be ready to go. It gets launched whenever the user does something to get out of the textfield( i.e. clicks on another field with the mouse or tabs out of it ).

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Is it possible to do this
 
Similar Threads
Session
Appending to an XML file
A database or not ?
how to implement role based access control in stand alone java application
Submit Form / POST on page refresh