
/* <Applet code="MyApplet8" width="480" height="480">
</Applet>
*/
import java.applet.*;
import java.awt.*;
public class MyApplet8 extends Applet
{
public void paint(Graphics g)
{
int w=getWidth();
int h=getHeight();
int y=0;
for(int j=1;j<=4;j++)
{
for(int i=0;i<=w;i=i+w/8)
{
g.setColor(Color.BLACK);
g.fillRect(i,y,w/8,h/8);
i=i+w/8;
g.setColor(Color.WHITE);
g.fillRect(i,y,w/8,h/8);
}
y=y+h/8;
for( int i=0;i<=w;i=i+w/8)
{
g.setColor(Color.WHITE);
g.fillRect(i,y,w/8,h/8);
i=i+w/8;
g.setColor(Color.BLACK);
g.fillRect(i,y,w/8,h/8);
}
y=y+h/8;
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.