In the following program code, the adapter class has been used. This class has been used as an anonymous inner class to draw a rectangle within an applet. This example demonstrates the functionality of the mouse press. That is on every click of the mouse from top left corner, we get a rectangle on the release of the bottom right.
The following program demonstrates the functionality of adapter class.
Output of the program:
Posted on: December 18, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles