int height = (int) Math.max(categoryImage.getHeight(), (titleRect.getHeight() + textRect.getHeight()));
width += 2 * SIDE_MARGIN + IMAGE_PAD;
height += TOP_MARGIN + BOTTOM_MARGIN;
// Create the background sprite
final BufferedImage image = gc.createCompatibleImage(width, height, Transparency.BITMASK);
final Graphics2D g2d = image.createGraphics();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setComposite(AlphaComposite.Src);
BackgroundPainter bp = new BackgroundPainter(BACKGROUND);
bp.paint(g2d, width, height);