@@ -0,0 +1,1760 @@
+import java.awt.BasicStroke;%0Aimport java.awt.Color;%0Aimport java.awt.Graphics;%0Aimport java.awt.Graphics2D;%0A%0Apublic class BouncingBox %7B%0A    int x;%0A    int y;%0A    Color color;%0A    int xDirection = 0;%0A    int yDirection = 0;%0A    %0A    final int SIZE = 20;%0A%0A    /**%0A     * Initialize a new box with its center located at (startX, startY), filled%0A     * with startColor.%0A     */%0A    public BouncingBox(int startX, int startY, Color startColor) %7B%0A        x = startX;%0A        y = startY;%0A        color = startColor;%0A    %7D%0A%0A    /** Draws the box at its current position on to surface. */%0A    public void draw(Graphics surface) %7B%0A        // Draw the object%0A        surface.setColor(color);%0A        surface.fillRect(x - SIZE/2, y - SIZE/2, SIZE, SIZE);%0A        surface.setColor(Color.BLACK);%0A        ((Graphics2D) surface).setStroke(new BasicStroke(3.0f));%0A        surface.drawRect(x - SIZE/2, y - SIZE/2, SIZE, SIZE);%0A        %0A        // Move the center of the object each time we draw it%0A        x += xDirection;%0A        y += yDirection;%0A%0A        // If we have hit the edge and are moving in the wrong direction, reverse direction%0A        // We check the direction because if a box is placed near the wall, we would get %22stuck%22%0A        // rather than moving in the right direction%0A        if ((x - SIZE/2 %3C= 0 && xDirection %3C 0) %7C%7C%0A                (x + SIZE/2 %3E= SimpleDraw.WIDTH && xDirection %3E 0)) %7B%0A            xDirection = -xDirection;%0A        %7D%0A        if ((y - SIZE/2 %3C= 0 && yDirection %3C 0) %7C%7C%0A                (y + SIZE/2 %3E= SimpleDraw.HEIGHT && yDirection %3E 0)) %7B%0A            yDirection = -yDirection;%0A        %7D%0A    %7D%0A%0A    public void setMovementVector(int xIncrement, int yIncrement) %7B%0A        xDirection = xIncrement;%0A        yDirection = yIncrement;%0A    %7D%0A%7D %0A

Create BouncingBox.java