Java Reference
In-Depth Information
Supplement 3G
Graphics (Optional)
Introduction
3G.1 Introduction to Graphics
DrawingPanel
One of the most compelling reasons to learn about using objects is that
they allow us to draw graphics in Java. Graphics are used for games, com-
puter animations, and modern graphical user interfaces (GUIs), and to
render complex images. Graphics are also a good way to practice the use
of parameters as discussed in the previous chapter.
Drawing Lines and Shapes
Colors
Drawing with Loops
Text and Fonts
3G.2 Procedural
Decomposition with
Graphics
In this optional supplement we will examine a few of the basic classes
from Java's graphical framework and use them to draw patterned two-
dimensional figures of shapes and text onto the screen.
A Larger Example:
DrawDiamonds
3G.3 Case Study: Pyramids
Unstructured Partial Solution
Generalizing the Drawing of
Pyramids
Complete Structured Solution
188
 
Search WWH ::




Custom Search