code: @Override
      public BufferedImage getBackground(int width, int height) {
          // create an opaque image
          BufferedImage img = new BufferedImage(width, height,
                  BufferedImage.TYPE_INT_RGB);
  
          Graphics2D g = img.createGraphics();
          RenderingHints hints = new RenderingHints(
                  RenderingHints.KEY_ANTIALIASING,
                  RenderingHints.VALUE_ANTIALIAS_ON);
  
          g.setRenderingHints(hints);
  
          // create the gradient color
          GradientPaint ytow = new GradientPaint(0, 0, _fromColor, width, height,
                  _toColor);
  
          g.setPaint(ytow);
          // draw gradient color
          g.fill(new Rectangle2D.Double(0, 0, width, height));
  
          // draw the transparent image over the background
          g.drawImage(img, 0, 0, null);
          g.dispose();
  
          return img;
      }
docs: {@inheritDoc}