Exercises
Lab01
1) There are at least five GUI components showing below. Label them all.
2) Describe a "string" in Computer Science.
3) Describe a "double" in Computer Science.
4) How do you get a string that is in a textField?
5) How do you change that string into a double?
6) How do you change a double into a string, as when you setText a numerical answer into a label?
7) Define and/or explain every underlined term.:
double d = Double.parseDouble( textField.getText() );
Complete this scavenger hunt using the current on-line Java API.
8) What is the lowest common ancestor of JButton, JLabel, and JTextField? _______________________
9) How many methods does the ActionListener interface specify? _________________________
10) What package is ActionEvent in? _________________________
11) How many classes extend JButton? __________________
12) How many constructors does JButton define? _________________________
13) How many methods does JButton define? _________________________
14) Write the code to instantiate a JTextField with "Enter name" in the field, and the field is 20 spaces wide.