hi every one
how are you all?
i need to do this click the image to see large

i have write a code the draw only one i dont know how to do all
this the code i wrote
import java.applet.* ;
import java.awt.* ;
public class hw01_Lines extends
Applet {
int SEGMENTS ;
public void init() {
SEGMENTS = getDefParam("Segments",10) ;
}
public void paint(Graphics g) {
int w = getSize().width - 10 ;
int h = getSize().height - 10 ;
g.drawRect(0,0,w,h) ;
double dx = (double) w / SEGMENTS ;
double dy = (double) h / SEGMENTS ;
double x = 0 ;
double y = 0 ;
for (int i = 0 ; i <=SEGMENTS ; i++) {
g.drawLine(0,0,(int) x,h) ;
g.drawLine(0,0,w, (int) y) ;
g.drawLine(w,h,(int) x,0) ;
g.drawLine(w,h,0, (int) y) ;
x += dx ;
y += dy ;
}
}
int getDefParam(
String ParamName, int dv) {
String s = getParameter(ParamName) ;
return (s == null) ? dv : Integer.valueOf(s).intValue() ;
}
}
any one help me ??