Results 1 to 3 of 3

What is adapter class?

This is a discussion on What is adapter class? within the Programming forums, part of the Web Designing & Development category; An adapter class provides an empty implementation of all methods in an event listener interface. Adapter classes are useful when ...

  1. #1
    Senior Member chinmay.sahoo's Avatar
    Join Date
    Dec 2013
    Location
    Banglore
    Posts
    266

    Thumbs up What is adapter class?

    An adapter class provides an empty implementation of all methods in an event listener interface. Adapter classes are useful when you want to receive and process only some of the events that are handled by a particular event listener interface. You can define a new class to act listener by extending one of the adapter classes and implementing only those events in which you are interested. For example, the MouseMotionAdapter class has two methods, mouseDragged()and mouseMoved(). The signatures of these empty are exactly as defined in the MouseMotionListener interface. If you are interested in only mouse drag events, then you could simply extend MouseMotionAdapter and implement mouseDragged() .

  2. #2
    Senior Member
    Join Date
    Jan 2016
    Posts
    145

    Default Re: What is adapter class?

    Hey,
    An adapter class provides the default implementation of all methods in an event listener interface. Adapter classes are very useful when you want to process only few of the events that are handled by a particular event listener interface. See more at: “ http://www.c-sharpcorner.com/UploadF...class-in-java/

  3. #3
    Senior Member
    Join Date
    Jan 2012
    Posts
    1,894

    Default Re: What is adapter class?

    An adapter class provides the default implementation of all methods in an event listener interface. Adapter classes are very useful when you want to process only few of the events that are handled by a particular event listener interface.

Tags for this Thread