« Return to Thread: DrawTarget not working

DrawTarget not working

by asherbaig :: Rate this Message:

Reply to Author | View in Thread

Hi,Thanks for your help.

In my robot i have added the given below features in order to drawOval
around my target but it is not working.Please help me solving this issue.

Thanks,
Asher


public void drawTarget
        (Graphics2D g, Color color,
        String name,Point2D point)  {

        g.setColor(color);

        double x = point.getX();
        double y = point.getY();

        g.drawString(name,(float)x+10,(float)y+10);
        g.drawLine((int)x, (int) y+5, (int) y+15, aimX);
        g.drawLine((int)x, (int) y+5, (int) y-15,aimY);
        g.drawLine((int)x+5, (int) y, (int) y,aimX);
        g.drawLine((int)x-5, (int) 5, (int) y,aimY);

        g.drawOval(
        (int) x-10,
        (int)y-10,
        (int)20,
        (int)20);
}

 « Return to Thread: DrawTarget not working