@Override
    public void onDraw(Graphics G, int viewX, int viewY) {
        if (X>viewX&&X<viewX+300&&Y>viewY&&Y<viewY+300)
        {
            Graphics2D g2d = (Graphics2D)G;
            G.setColor(Color.cyan);
            G.drawLine((int)previousX-viewX, (int)previousY-viewY, (int)X-viewX,(int)Y-viewY);
            G.setColor(Color.white);
            G.drawLine((int)previousX-viewX, (int)(previousY+1)-viewY, (int)X-viewX,(int)Y+1-viewY);
        }
    }