import java.awt.*; import java.awt.geom.*; import javax.swing.*; public class Robot { public Robot (JPanel wp, float _x, float _y){ panel = wp; x=_x; y=_y; view = new Rectangle2D.Double(x, y, 20, 20); } // end constructor public void move(){ x+=2.0; y-=1.0; } public void draw ( Graphics2D g) { view.setFrame(x,y,20.0,20.0); g.fill(view); } JPanel panel; double x,y; Rectangle.Double view; }