How to Draw Rectangle in Applet java code?
// Draw Rectangle in Applet java code
public static void drawRect(Graphics g, int i, int j, int k, int l, int i1)
{
i -= i1 / 2;
j -= i1 / 2;
k += i1;
l += i1;
for(int j1 = 0; j1 < i1; j1++)
{
g.drawRect(i, j, k, l);
i++;
j++;
k -= 2;
l -= 2;
}
}
public static void drawRect(Graphics g, int i, int j, int k, int l, int i1)
{
i -= i1 / 2;
j -= i1 / 2;
k += i1;
l += i1;
for(int j1 = 0; j1 < i1; j1++)
{
g.drawRect(i, j, k, l);
i++;
j++;
k -= 2;
l -= 2;
}
}
Comments
Post a Comment