How to write an EventAdapter, EventListener of own?

Posted on 2004-11-18
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(){


class B() extends ???
  line = readTextFromFile(f);  

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

Question by:chenwei
    LVL 86

    Accepted Solution

    LVL 2

    Expert Comment

    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 :)
    LVL 92

    Assisted Solution


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    731 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now