My opinion is that this has to do with the default settings for the layout managers. When you create a LayoutManager without giving any constraints, the default constraints will be used. If you add a component to the BorderLayout without giving any constraints, for example, it will be added to the center pane, and componets added later will simply cover the ones added before so you only see the last one added. The following code:
import java.awt.*;
public class
test extends Frame
{
Button bNorth = new Button("North");
Button bSouth = new Button("South");
Button bEast = new Button("East");
Button bWest = new Button("West");
Button bCenter = new Button("Center");
public test()
{
setLayout(new FlowLayout());
add(bNorth);
add(bSouth);
add(bWest);
add(bEast);
add(bCenter);
setLayout(new BorderLayout());
setSize(300,300);
setVisible(true);
validate();
}
public static void main(String args[])
{
test tf = new test();
}
}
is equivalent to:
import java.awt.*;
public class test extends Frame
{
Button bNorth = new Button("North");
Button bSouth = new Button("South");
Button bEast = new Button("East");
Button bWest = new Button("West");
Button bCenter = new Button("Center");
public test()
{
setLayout(new BorderLayout());
add(bNorth);
add(bSouth);
add(bWest);
add(bEast);
add(bCenter);
setSize(300,300);
setVisible(true);
validate();
}
public static void main(String args[])
{
test tf = new test();
}
}
and I guess the same should be ture for other layout managers