private void drawShape(Graphics g,Boolean pack) {

        if (currentshape == shape.LINE) 
        {
            //packet
            if(pack)
            {
                Packet p=new Packet(diffrentShapes.LINE, currentColor, startX, startY, currentX, currentY);
                try {
                        oos.writeObject(p);
                        oos.flush();
                    } catch (Exception ex) {
                        System.err.println("Object output error: " + ex);
               }
            }
            g.drawLine(startX, startY, currentX, currentY);
        } 
        else if (currentshape == shape.OVAL)
        {
            DrawRectOval(g, pack, startX, startY, currentX, currentY);
        }  
        else if (currentshape == shape.RECT)
        {
            DrawRectOval(g,  pack ,startX, startY, currentX, currentY);
        }
    //        else if (currenttool == tool.eraser)
    //        {
    //            g.setColor(fillColor);
    //            g.fillRect(currentX, currentY, 17, 17);
    //        }
        // else if (currentshape == shape.FILLED_OVAL) { DrawRectOval(g, true, startX, startY, currentX, currentY); }
        //else if (currentshape == shape.FILLED_RECT) {  DrawRectOval(g, true, startX, startY, currentX, currentY); }
    }