Hi,
In the following code I get different effects for placing setSize() function at places 1 and 2.
import java.awt.*;
class winframe extends Frame{
public static void main(
String[] argS){
Frame f = new Frame();
// f.setSize(400,400); //1
f.add(new Button("North"));
f.add(new Button("South"));
f.setLayout(new FlowLayout());
f.setVisible(true);
f.setSize(400,400); //2
}
}
If setSize() is at 1, i get the buttons aligned in the center at the top of frame (expected behavior from a Flow Layout!!)
but if i put it at 2, i get the buttons aligned in the left of the frame. Can anyone explain this behavior?. There must be some BorderLayout funda too behind this.
TIA