I typed the following code:-
import java.awt.*;
class L
{
Frame f;
Button b1;
Button b2;
Button b3;
Button b4;
Button b5;
L()
{
Frame f=new Frame("my frame");
Button b1=new Button("1");
Button b2=new Button("2");
Button b3=new Button("3");
Button b4=new Button("4");
Button b5=new Button("5");
f.setSize(1000,1000);
b1.setSize(10,10);
b2.setSize(10,10);
b3.setSize(10,10);
b4.setSize(10,10);
b5.setSize(10,10);
f.add(b1,BorderLayout.NORTH);
f.add(b2,BorderLayout.SOUTH);
f.add(b3,BorderLayout.EAST);
f.add(b4,BorderLayout.WEST);
f.add(b5,BorderLayout.CENTER);
f.setVisible(true);
}
public static void main(
String s[])
{
new L();
}
}
and I got 5 buttons which were covering the whole frame..why are not they taking the size which i specified(10,10)..??