Question 5:Write a Java program that handles all mouse events and shows the event name at the center of the window when a mouse event is fired and trace the mouse pointer path only for dragging. / * applet>*/ import java.awt.*; import java.awt.event.*; import java.applet.*; public class mouseevent extends Applet implements MouseListener, MouseMotionListener { final Font fnt=new Font("Verdana",Font.PLAIN,20); String msg=" "; public void init() { addMouseListener(this); addMouseMotionListener(this); } public void paint(Graphics g) { g.setFont(fnt); g.drawString(msg,20,3 0); } public void mouseEntered(MouseEvent me) {msg="mouse entered"; repaint(); } public void mousePressed(MouseEvent me) { msg="mouse pressed"; repaint(); } public void mouseClicked(MouseEvent me) { msg="mouse clicked"; repaint(); } public void mouseExited(MouseEvent me) { msg="mouse exited"; repaint(); } public void mouseReleased(MouseEvent me) { msg="mouse released"; repaint(); } public void mouseMoved(MouseEvent me) { msg="mouse moved"; repaint(); } public void mouseDropped(MouseEvent me) { msg="mouse dropped"; repaint(); } public void mouseDragged(MouseEvent me) { msg="mouse dragged"; repaint(); } }