10.9. Summary

Java 2D enables the artistic imagination of any programmer to produce high-quality, professional graphics. Java 2D opens the door to numerous possibilities; you can

  • Draw or fill any Shape. Simply call the Graphics2D's draw or fill methods with the shape as an argument.

  • Take advantage of the setPaint method in the Graphics2D class to paint shapes in solid colors (Color), gradient fills (GradientPaint), or with tiled images (TexturePaint).

  • Explore transparent shapes and change mixing rules for joining shapes. Numerous Porter-Duff mixing rules in the AlhpaComposite class define how shapes are combined with the background.

  • Break the “one pixel wide” pen boundary and create a BasicStroke to control the width of the pen, create dashing patterns, ...

Get Core Web Programming, Second Edition 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.