code: public void setGraphics(java.awt.Graphics2D g2d) {
          this.g2d = g2d;
          // anti-aliasing methods
          g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
          g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
      }
docs: Set the Java2D graphics object.