Hey I've created a simple Frame that displays the olympic rings but I try to port them to applet without any success. This is the code I'm running:
import java.awt.*;
import javax.swing.*;
public class CirclesApplet extends JApplet {
private static final long serialVersionUID = 1L;
Container c;
public void init(){
c = getContentPane();
c.setSize(300, 300);
c.setBackground(Color.GRAY);
c.setLayout(new FlowLayout());
}
public void paintComponent(Graphics g){
super.paintComponents(g);
g.setColor(Color.BLUE);
g.drawOval(65, 90, 50, 50);
g.setColor(Color.YELLOW);
g.drawOval(95, 110, 50, 50);
g.setColor(Color.BLACK);
g.drawOval(125, 90, 50, 50);
g.setColor(Color.GREEN);
g.drawOval(155, 110, 50, 50);
g.setColor(Color.red);
g.drawOval(180, 90, 50, 50);
g.drawString("Olympic Rings", 120, 185);
}
}
What am I doing wrong?