How to implement the methods in MouseListener interface.