Witam.

Jak mogę ustawić w JTextPane wczytany obrazek jako tło powtarzające się w bok i w dół?

Mam coś takiego:

private BufferedImage bufferedBg;
private ImageIcon pictureBg;

(...)

try
{
    bufferedBg = ImageIO.read(getClass().getResource("bg.png"));
    pictureBg = new ImageIcon(bufferedBg);
}
catch (IOException ioe) {}

(...)

textMain.insertIcon(pictureBg);

Niestety to nie działa. Obrazek się wczytuje, ale tło jTextPane pozostaje takie samo. Jest na to jakiś inny sposób?