CS 1401, Quiz #7

Date: Tuesday, March 7, 2007
Name: ____________________________________________________________
Class section (9:00 am or 10:30 am): _______________________________

1. For each of the following topics, write "yes" or "no" depending on whether this topic is covered in Chapter 7, the chapter that you were supposed to read before the class:

user-defined methods

2-dimensional arrays

void methods

exceptions

2. Draw a pane that will appear as a result of the following code. What will happen is you do not use setVisible(true)?

firstNameL = new JLabel("Enter your first name:", SwingConstants.CENTER);
lastNameL = new JLabel("Enter your last name:", SwingConstants.CENTER);
gradeInQuiz7L = new JLabel("Enter your grade:", SwingConstants.CENTER);

firstNameTF = new JTextField(10);
lastNameTF  = new JTextField(10);
gradeInQuiz7TF  = new JTextField(10);

Container pane = getContentPane();

pane.setLayout(new GridLayout(2,3));

pane.add(firstNameL);
pane.add(lastNameL);
pane.add(gradeInQuiz7L);
pane.add(firstNameTF);
pane.add(lastNameTF);
pane.add(gradeInQuiz7TF);

setSize(400, 100);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);