Apply Your Knowledge

Review Questions

1:What is the relationship between the Canvas class and the Graphics class?
2:Name three Component subclasses that support painting.
3:What is the difference between the paint() and repaint() methods?
4:What is the difference between the Font and FontMetrics classes?
5:What is clipping?
6:What is the relationship between clipping and repainting?

Exam Questions

1:Which of the following is passed as an argument to the paint() method?
  1. Canvas object

  2. A Graphics object

  3. An Image object

  4. A Paint object

2:Which of the following methods does the AWT invoke to support paint and repaint operations?
  1. paint()

  2. repaint()

  3. draw()

  4. redraw()

3:Which of the following classes has a paint() method?
  1. Canvas

  2. Image

  3. Frame

  4. Graphics

4:Which of the following ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.