public class Test extends JApplet
{
TestEventID = 23456;//be careful to set this ID
TestPanel tp = new TestPanel();
...
public void sendTestMessage()
{
ActionEvent ae =new ActionEvent(viewPage,TestEventID,"A test event");
tp.dispatchEvent(ae);
}
}
Class TestPanel extends JPanel
{
TestEventID = 23456;//be careful to set this ID
...
public void processEvent(AWTEvent awte)
{
if(awte.getID()==TestEventID)
{
try
{
Thread.sleep(5000);
System.out.println("processEvnt  finished");
}
catch(InterruptedException ie)
{}
}
else
super.processEvent(awte);
}//end of processEvent
}