Author Topic:   Last question
Anju Rao
ranch hand
posted March 08, 2000 03:17 PM         
Maha Anna & others,

I copied this code from Event handling chapter of R&H to implement enableEvents. I am creating a Button in my Applet using MyButton. Please see below.

class MyButton extends Button
{
MyButton(String s)
{ super(s);
enableEvents(AWTEvent.ACTION_EVENT_MASK);
}

public void processActionEvent(ActionEvent ae)
{
System.out.println("Process Event");
super.processActionEvent(ae);
}
}

I get a compilererror saying that ActionEvent is not found in
void processActionEvent(ActionEvent) - how do u implement this? Can u see anything wrong this right away?

Thanks,

maha anna
bartender
posted March 08, 2000 03:23 PM             
ActionEvent is in java.awt.event package. You have to import it.
Just add this statement.
import java.awt.event.*;
You MUST BE KNOWING this already. I think your mind is loaded FULLY for today( ) Take rest.
regds
maha anna

[This message has been edited by maha anna (edited March 08, 2000).]

Anju Rao
ranch hand
posted March 08, 2000 03:30 PM         
Please ignore this.

|