> @Override
> public Visual getRepresentation() {
> Picture picture = null;
> if (selectedIndex!=-1){
> Bounds headerBounds = getHeaderBounds(selectedIndex);
> BufferedImage bImg = new
> BufferedImage(headerBounds.width,
> headerBounds.height, BufferedImage.TYPE_INT_RGB);
>
> Graphics2D graphics = bImg.createGraphics();
>
> graphics.clipRect(headerBounds.x, headerBounds.y,
> headerBounds.width,
> headerBounds.height);
You probably don't need the call to clipRect().
> graphics.translate(headerBounds.x, headerBounds.y);
>
> paint(graphics);
>
> graphics.drawImage(bImg, headerBounds.x, 0, null);
Not sure why you are calling drawImage() here.
> graphics.dispose();
>
> picture = new Picture(bImg);
> }
>
> return picture;
> }