[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to write an EventAdapter, EventListener of own?

Posted on 2004-11-18
6
Medium Priority
?
256 Views
Last Modified: 2010-03-31
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.?

0
Comment
Question by:chenwei
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 252 total points
ID: 12616376
0
 
LVL 2

Expert Comment

by:jprgn
ID: 12617716
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 :)
0
 
LVL 92

Assisted Solution

by:objects
objects earned 248 total points
ID: 12620270
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month19 days, 16 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question