Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One FcusListner for several jtextfields?

Status
Not open for further replies.

sagn

Programmer
Jun 7, 2001
166
US
HI

I have a form with about 20 textfields on it.
I;d like to highlight the jlabel associated with the jtextfield that is in focus. That is easy enough to do,
what I am wondering is if there is a way to do this for each JTEXTFIELD/JLABEL without writing 20 different
focusevent actions.

I know for the Jbutton you can extract which button
was pressed. Is there something similar for JTextfields?

thanks.
 
If you look at the javadocs for FocusListener and then compare your FL to the ActionListener, where you used one AL for multiple button, you should be able to transfer your knowledge from AL to FL.

If not, you could at least improve your question.

don't visit my homepage:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top