Quiz
Test whether your Java graphics skills are taking shape by answering the following questions.
Questions
1: | What method is used to change the current color before you draw something in a program?
Could you repeat the question?
| 2: | If you want to use the height and width of a component to determine how big something should be drawn, what can you use?
A ruler and a friend who's good at math getHeight() and getWidth() getSize().height and getSize().width
| 3: | What societal problem did this hour's first example program call attention to?
People who compress air in places with signs that clearly indicate it is prohibited, especially restaurants
|
AnswersA1:
| b. You can use the setBackground() method to set the background color of an applet, and you can use the setColor() method of the Graphics class to select the current color. | A2:
| c. | A3:
| c. Though overpopulation is a pretty big deal, too. |
|