I need to add an image background behind my JTable, should not scrole down while scrolling my JTable. currently i have added a Image behing my JTable. using the paint method.
public void paint(Graphics g)
{
// First draw the background image - tiled
Dimension d = getSize();
for (int x = 0; x < d.width; x += image.getIconWidth())
for (int y = 0; y < d.height; y += image.getIconHeight())
g.drawImage(image.getImage(), x, y, null, null);
// Now let the regular paint code do it's work
super.paint(g);
}
problem is that. This JTable is at JScrollPane. and when scrolling the pane. also scrolls down the image. and repeats the image at each scroll.
is there any way to restrict scroll on background only. thanks