Charles Bell
Posts: 519
Nickname: charles
Registered: Feb, 2002
|
|
Re: what isadapter class
|
Posted: Feb 17, 2003 6:51 PM
|
|
There are several java adapter classes. MouseAdapter is one you can use to keep from having to implement all the methods of a MouseListener interface. You creat your own extending the adapter class and then override the methods you really want to use such as the public void mouseClicked(MouseEvent me){ //put your code in here }
the adapter class is kind of a shell class which doesn't do anything but implement all the interface methods. Saves time writing code. When you want to use one of the methods you override the appropriate method in your own subclass and customize the behavior you want.
Other adapter classes: WindowAdapter MouseAdapter XMLReaderAdapter ComponentAdapter ContainerAdapter DragSourceAdap ter DropTargetAdapter FocusAdapter KeyAdapter .....
|
|