File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes applet action listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Applets
Bookmark "applet action listener" Watch "applet action listener" New topic
Author

applet action listener

krishna krottapalli
Greenhorn

Joined: Apr 05, 2014
Posts: 1
Hi,

my scenario is a s below:

i have an applet with 10 fields in it. i need an action listener such that when you click on a particular field, a variable should be assigned to a value. once the cursor is out of the same field, the variable should be re assigned to the old/default value.
i am able to code the assigning part. please help in re-assigning the variable to old or default value once anything is clicked or selected out of that field.

thanks,
krishna
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

If these are text fields, then the "action listener" you're looking for is a Focus Listener. The events it supports are "focus gained" and "focus lost", which are what you described. The tutorial is here: How to Write a Focus Listener.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

And, welcome to the Ranch!
 
GeeCON Prague 2014
 
subject: applet action listener