face difficulty in organizing the design of my program and also I had another difficultly in labeling 3 or 4 sentences each one in a new line
code:
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class answer extends Applet implements ActionListener
{
Button b1=new Button("red");
Button b2=new Button("pink");
Button b3=new Button("Black");
Button b4=new Button("blue");
Button b5=new Button("brown");
public void init ()
{
Label L1 = new Label(" button programs")
Label L2 = new Label(" This is My Program")
add(b1);
add(b2);
add(b3);
add(b4);
add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
public void paint (Graphics g)
{
g.setColor(blue);
g.drawOval(30, 50, 200, 200);
g.drawOval(19, 100, 200, 200);
}
}
}
button programs (
This should be center)
This is My Program (
This should be new line +center)
circles
should be down and center