Java Reference
In-Depth Information
2.
Name some commonly used GUI components and their uses.
3.
Name a GUI component that can be used for both input and output.
4.
Name two input GUI components.
5.
Why do you need labels in a GUI program?
6.
Why would you prefer a GUI program over a non-GUI version?
7.
What are the advantages of problem analysis, GUI design, and algorithm
design over directly writing a program?
8.
Modify the temperature conversion program to convert centimeters to
inches, and vice versa.
9.
Modify the program to compute the area and perimeter of a rectangle so
that your new program will compute the sum and product of two numbers.
Fill in the blanks in each of the following:
a.
A(n) _____________ places GUI components in a container.
b.
Clicking a button is a(n)_____________.
c.
The method _____________ is invoked when a button is pressed and
a(n) _____________ is registered to handle the event.
d.
_____________operator is needed to instantiate an object.
e.
A class
10.
6
has
two
types
of members:
_____________
and
_____________.
f.
To create a window, you extend the _____________class.
g.
Every GUI program is a(n)_____________ program.
h.
The method _____________ gets the string in the
JTextField
and
the method _____________ changes
the string displayed in a
JTextField
.
If
Student
is a class and you create a new
class
GradStudent
by
extending
Student
, then
Student
is a(n) _____________ and
GradStudent
is a(n) _____________.
i.
Event and event
listener classes
are contained in the package
j.
_____________.
k.
The unit of measure of length in a window is _____________.
11.
Write necessary statements to create the following GUI components:
a.
A
JLabel
with the text string
"Enter the number of courses"
b.
A
JButton
with the text string
"Run"
c.
A
JTextField
that can display 15 characters
d.
A window with the title
"Welcome Home!"
e.
A window with a width of 200 pixels and a height of 400 pixels
f.
A
JTextField
that displays the string
"Apple tree"
Search WWH ::
Custom Search