Java 2D Shapes
Home ] Up ] Simple Shapes ] [ Java 2D Shapes ]

 

Simple Example
Sun's Java 2D Demo

 

Here is some introductory information on drawing shapes using Java 2D.

Note: Entire books have been written on just this subject, so we won't go into great detail on Java 2D in this course.

Java 2D provides the ability to:

  • Draw shapes whose classes use inheritance to share attributes and behavior:
    • Line2D, Rectangle2D, Ellipse2D
  • Draw more complex shapes:
    • Arcs, quadratic and cubic curves, etc.
  • Draw user-defined shapes, using the same inheritance support
  • Draw lines with different thicknesses, different "strokes" (dotted, dashed, etc)
  • Fill shapes with more complex fillings, such as patterns and blends.
  • Perform transformations on those shapes such as rotation, shift, stretch, etc.
 

This page was last modified on 02 October, 2007