O'Reilly logo

Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java™ Applications by Romain Guy, Chet Haase

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required