public void paint(Graphics g) {
		Graphics g0 = g;
		if (isOpaque()) {
			if (offscreenImage == null) initOffscreenImage();
			if (offscreenImage != null) g = offscreenImage.getGraphics();
			Dimension size = getSize();
			g.setColor(getBackground());
			g.fillRect(0, 0, size.width, size.height);
			g.setColor(getForeground());
		}
		contents.mapPaint(g);
		if (isOpaque() && offscreenImage != null) {
			g0.drawImage(offscreenImage, 0, 0, this);
		}
		super.paint(g0);
	}