Can I have a MouseListener without implementing all of the methods?
Currently my class implements MouseListener and I have to implement all of the abstract methods (mouseEntered, mouseExited, etc.). However, the only one I use is mouseClicked. Is there a way to not implement all of the unused methods?
[241 byte] By [
jamdra] at [2007-10-1 0:04:50]

Yes, ALL of the methods must be implemented in a concrete class before you can use the class, otherwise it is an abstract class.
But like the previous poster noted, MouseAdapter was created for exactly this purpose. It has a default implementation for every required method so you only have to write the ones you are interested in.