Java Reference
In-Depth Information
LISTING 3.9
continued
DISPLAY
the
drawImage
method of the
Graphics
class or to use a label to display an image.
Your choice should be based on the particular needs of the program.
SELF-REVIEW QUESTIONS
(see answers in Appendix N)
SR 3.44
How many frames, panels, image icons, and labels are declared in the
LabelDemo
program?
SR 3.45
Consider one of the label instantiation statements from the
LabelDemo
program:
label2 =
new
JLabel
("Devil Right", icon,
SwingConstants.CENTER);
Explain the role of each of the three parameters passed to the
JLabel
constructor.
Search WWH ::
Custom Search