import java.awt.*;public class communicationDemo extends java.applet.Applet {Image pixelImage;StringBuffer mouseStroke;   public void init(){          pixelImage = createImage(512,512);     }      public boolean mouseDown(Event evt, int x, int y){          mouseStroke = new StringBuffer();          mouseStroke.append(x+","+y+",");          return true;   }      public boolean mouseDrag(Event evt, int x, int y){         mouseStroke.append(x+","+y+",");   		 return true;   }      public boolean mouseUp(Event evt, int x, int y){         System.out.println(mouseStroke);         return true;   }      public void update(Graphics g){         paint(g);   }      public void paint(Graphics g){   	     g.drawImage(pixelImage,0,0,this);      }}/*Now we have created a storage buffer for the coordinates on our mouse stroke.The list of points (x and y pairs) will be printed to the terminal each timewe lift the mouse button after dragging it around in the applet window.   */