Chapter 7. Gradients

GRAPHICS design follows trends, and a current trend is to use gradients everywhere. Beyond the fashion, gradients are easy and versatile tools that can be used to create advanced effects like reflections and fade-out. Because of their versatility and ease of use, they are the most widely used Paint state of the Graphics object.

Up to J2SE 5.0, drawing a gradient was as simple as creating a new instance of java.awt.GradientPaint and setting it on a Graphics object. This class is very useful but sports some limitations. For example, you can draw only linear gradients, and you can specify only two colors. If you work with graphic designers, who use advanced tools like those found in Adobe Photoshop, you might find yourself in ...

Get Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java™ Applications 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.