Original Post
I wrote a program to display squares on the screen but when i minimize the window or move a portion off of the screen the squares disappear. that is if i minimize then all the squares disappear and if i move a portion off then the portion of the squares that went off disappears. how do i stop this. here is the src
import java.awt.*;
import java.applet.*;
public class DrawSquare extends Applet
{
int width = 50, height = 50; int winX=20;
int x=winX , y=0; int xdiff = 80, ydiff = 70;
public void paint(Graphics g)
{
g.setColor(Color.blue);
// g.fillRect(0,0,200,200);
for(int index=0; index <=6; index++)
{
for(int i=0; i < index; i++)
{
g.fillRect(x, y, width, height);
x+=xdiff;
}
x=winX;
y+=ydiff;
}
g.setColor(Color.blue);
}
}