Link to home
Start Free TrialLog in
Avatar of chenwei
chenwei

asked on

How to write an EventAdapter, EventListener of own?

I am going to write a program as follow:

class A() extends ???
{
...
  B b = new B();
  b.addMyListener(new MyEventAdapter(){
    public void handleMyEvent1(){
      doSomework();
    }
  });
};

...

class B() extends ???
{
...
...
  line = readTextFromFile(f);  
  if(line.equals("OK"))
   this.fireMyEvent1(MyEvent.EVENI1);
...
...
}

My question: how can I write the so-called MyEvent, MyEventAdapter and even the MyListener etc.?

ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jprgn
jprgn

for creating your event you have 2 make ur interface and its adapter implementation your self, if you r well in making u can do it :)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial