|
-
Jun 15th, 2002, 03:15 AM
#1
Dividing grid
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);
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|