␡
- The Basic Java 2D Recipe
- Set the Graphics2D Context...
- ...and Render Something
- Rendering on Components
- Shape Primitives
- Graphics Stroking
- Fill Attributes and Painting
- Transparency and Compositing
- Text
- Clipping
- Coordinate Space Transformations
- Techniques for Graphical User Input
- Double Buffering
- Comprehensive Example: Kspace Visualization
- Summary
This chapter is from the book
...and Render Something
After setting the rendering context with any of the previous methods, it is time to complete the recipe and request a rendering of a shape, line, or image. This final step is accomplished with one of several methods contained in the Graphics2D object. For this chapter we will primarily use the draw(), drawLine(),drawString(), and fill() methods, but keep in mind that many other drawing methods exist.
You should examine the Graphics2D documentation at this time: http://java.sun.com/j2se/1.3/docs/api/java/awt/Graphics2D.html