code: public static void disableDoubleBuffering(Component c)
      {
          RepaintManager currentManager = RepaintManager.currentManager(c);
          currentManager.setDoubleBufferingEnabled(false);
      }
docs: Turn the cache off, so printing will work.
  @param c Component.