Empty Method bodies on Java callback interfaces?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Empty Method bodies on Java callback interfaces?

Zachary1234-2
Say for example that I wish to implement only one of the methods in the MouseMotionListener interface, mouseMoved.  Once I have finished that,
I can create an object of my implementing class and then register that listener on a Component or JComponent via addMouseMotionListener.

-Now, by using an interface and non an Adapter (class) approach, with my MouseMotionListener example, there is one method that must be implemented and left totally blank.  [b]Does the AWT/SWING subsystem still send distinct events to those empty callback methods, or is that prevented by some kind of optimisation?[/b]