| 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.
|
 |
 |
|
|
subject: Is it possible to do this
|
|
|