code: public void redrawBoxes()
      {
          Graphics2D ig = img.createGraphics();
          clearCanvas();
          viewport.draw(new GraphicsRenderer(ig));
          revalidate();
      }
docs: Redraws all the rendered boxes.