Hello i'm trying to make an image fill the screen. The image is 20x20 pixels. i don't really know how to explain it. I think the code might explain it better thank you for your help. and the screen is 800x600 pixels. I have looked for a few days and found nothing.i want it to fill the whole screen with this image i just cant get it and to fill it i need it to repeat and not just use one square.
private int GLW = 0;
private int GLH = 0;
private int add = 20;
private int redo1 = 0;
while(redo1 < 24000){
int redo = 0;
if(redo < 1){
//image here
java.net.URL imageURL = getClass().getResource("grass.png");
img = new JLabel(new ImageIcon(imageURL));
JPanel pan1 = new JPanel();
pan1.add(img);
add(img, BorderLayout.CENTER);
img.setVisible(true);
img.setBounds(GLH,GLW,20 ,20 );
GLW = GLW + add;
GLH = GLH + add;
}
GLW=GLW+20;
}
javatag while you're at it.