Skip to Main Content
Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization
book

Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

by Alejandro Terrazas, John Ostuni, Michael Barlow
November 2002
Intermediate to advanced content levelIntermediate to advanced
848 pages
19h 59m
English
Sams
Content preview from Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Fill Attributes and Painting

Assigning material for painting is done by creating a Paint object (specifically, an object implementing the Paint interface) and adding it to the Graphics2D context with the setPaint() method. As you will see next, three general types of Paint objects already exist and are easily instantiated. Any of these can readily be used as arguments to setPaint(). Before going into these three general types, it is worthwhile to understand the Paint interface and how it relates to a second interface, the PaintContext interface. An understanding of these two interfaces will be useful when we discuss custom painting later.

The Paint interface consists of a unitary method that returns a PaintContext:

 PaintContext createContext(ColorModel ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
JavaFX 9 by Example

JavaFX 9 by Example

Carl Dea, Gerrit Grunwald, José Pereda, Sean Phillips, Mark Heckler

Publisher Resources

ISBN: 0672320940Purchase book