code: public static void enableAA(final Graphics pGraphics) {
          ((Graphics2D) pGraphics).setRenderingHint(
                  RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON
          );
      }
docs: Enables anti-aliasing in the {@code Graphics} object.
  <p/>
  Anti-aliasing is enabled by casting to {@code Graphics2D} and setting
  the rendering hint {@code RenderingHints.KEY_ANTIALIASING} to
  {@code RenderingHints.VALUE_ANTIALIAS_ON}.
  
  @param pGraphics the graphics object
  @throws ClassCastException if {@code pGraphics} is not an instance of
  {@code Graphics2D}.
  
  @see java.awt.RenderingHints#KEY_ANTIALIASING