Fix MouseListener bug introduced in new versions of Java 1.7