|
Code Samples Index
These code examples and other materials are subject to Sun Microsystems, Inc.
Legal Terms
Stroking or Filling with a Color
// Use a predefined color.
g2d.setColor(Color.red);
drawShape(g2d);
// Use a custom color.
int red = 230;
int green = 45;
int blue = 67;
g2d.setColor(new Color(red, green, blue));
drawShape(g2d);
|
Examplets provided by permission of the publisher, Addision-Wesley, and
Author Patrick Chan.
Order this book from Amazon
|