I have drawn a grid of 1000000 lines.
Now i want to show a dark line after every 10 lines.
code:

public void paintComponent(Graphics g){
setBackground(Color.lightGray);
super.paintComponent(g);
for(int i=0;i<1000000;i=i+5){

if(i==100*j){

g.setColor(Color.darkGray);

j=j+1;

}
else {

g.setColor(Color.white);
}

g.drawLine(0,i,1000000,i);

g.drawLine(i,0,i,1000000);

}
}