Consider the following program...
import java.awt.*;
public class MyFrame
{
public static void main(
String[] args)
{
Frame fr = new Frame();
Panel p = new Panel();
Button b1 = new Button("North");
p.add(b1);
Button b2 = new Button("South");
fr.add("North", p);
fr.add("South", b2);
fr.setSize(300,400);
fr.setVisible(true);
}
}
Which of the following statements are correct?
1) On resizing the frame, both "North"button and "South"button will resize
2)On resizing, the height of "North" will change but "South" will not
3) On resizing, the width of "North" will change but "South" will not
4) On resizing, the width of "South" will change but width of "North" will not change
5)Nothing can be said about the behaviour.
Ans : 4)
Can anyone explain me the above question and how is the answer 4) right?