hi,
does anyone know how it would be possible to change my code so that the circles drawn by the applet are resized as the applet screen size is changed?
import java.awt.Graphics;
import javax.swing.JApplet;
import java.awt.Color;
@SuppressWarnings("serial")
public class OvalApp extends JApplet
{
private int width, height, x=10, y=10;
public void init()
{
height=getSize().height;
width=getSize().width;
}
public void paint(Graphics g)
{
g.setColor(Color.green);
super.paint(g);
g.drawOval(0, 0, width, height);
g.drawOval(x, y, width - 2*x, height- 2*y);
g.drawOval(2*x, 2*y, width - 4*x, height-4*y);
g.drawOval(3*x, 3*y, width - 6*x, height-6*y);
}
}