public MyCanvas() {
	      
	    	setDoubleBuffered(false);
	    	
	    	addMouseListener(new MouseAdapter() {
	    		public void mousePressed(MouseEvent e) {
	    			oX = e.getX();
	    			oY = e.getY();
		
	          }
	    	});
	    	addMouseMotionListener(new MouseMotionAdapter() {
	            public void mouseDragged(MouseEvent e) {
	              cX = e.getX();
	              cY = e.getY();
	             graphics2D.setStroke(new BasicStroke(10));
	             graphics2D.setColor(new Color(rValue,gValue,bValue));
	              if (graphics2D != null)
	            	  graphics2D.drawLine(oX,oY, cX, cY);
	              repaint();
	              oX = cX;
	              oY = cY;
	            }
	         });
	    	
	    }