> Hi,
>
[quoted text clipped - 3 lines]
> I'd like the background to be filled (and act as a pattern rather than a
> background image) with a given gif, even after resizing.
something like this:
public class JPatternPanel extends JPanel {
Image pattern;
public void paintComponent(Graphics g) {
super.paintComponent(g);
Insets insets = getInsets();
Dimension size = getSize();
if(patterm != null) {
int width = pattern.getWidth(null);
int height = pattern.getHeight(null);
if(width > 0 && height > 0) {
for(int i = insets.left; i < size.width - (insets.left +
insets.right); i += width) {
for(int j = insets.top; i < size.height - (insets.top +
insets.bottom); j += height) {
g.drawImage(pattern, i, j, null);
}
}
}
//paint here whatever you need
}
____________
http://reader.imagero.com the best java image reader.