Try subclassing TitledBorderand overriding the method paintBorder:
@Overide
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
{
super.paintBorder(c, g, x, y, width, height);
g.drawImage(img, xImageOffset, yImageOffset, imgWidth, imgHeight, observer);
}
I'm not desperately sure that this is a completely correct method call, but you get an idea; as soon as you access the object Graphics, you can draw everything you need.