I found this question in
SCJP practice
test? Can we expect this type of question in real Beta exam, even though AWT is not covered in exam contents?
1. import java.awt.*;
2.
3. public class Birthdays extends Frame {
4. Birthdays() {
5. super("Birthday Reminder");
6.
String lblsP1[] = {"Name:", "Birthday:", "Address:"};
7. String butnsP2[] = {"Add", "Save", "Exit"};
8. Panel panelTop = new Panel();
9. Panel panelBot = new Panel();
10. panelTop.setLayout(new GridLayout(3,2,3,3));
11. for(int x = 0; x < lblsP1.length; x++) {
12. panelTop.add(new Label(lblsP1[x]));
13. panelTop.add(new TextField());
14. }
15. for(int y = 0; y < butnsP2.length; y++) {
16. panelBot.add(new Button(butnsP2[y]));
17. }
18. add(panelTop, BorderLayout.NORTH);
19. add(panelBot, BorderLayout.SOUTH);
20. }
21. }