Hey,
I'm having problems creating an applet. Heres the image I need to recreate. The drawing should scale, so that it reaches the full width and
height of the applet.
http://img503.imageshack.us/my.php?image=graphicsafx5.jpg
I created a similar one (the code is below), but don't know how to modify it to create the image in the above link. Do I need a for loop? like for ( int i = 0; i < 10; ++i )
import java.applet.Applet;
import java.awt.*;
public class AprilTest1 extends Applet
{
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D)g;
int width = getWidth();
int height = getHeight();
g2.setColor( Color.black );
g2.fillRect( 0, 0, width, height);
int pen_width = width/90 + 1;
g2.setStroke(new BasicStroke(pen_width));
g2.setColor( Color.white );
g2.drawRect( width/4, height/4, width/2, height/2);
}
}