From Progzoo
Revision as of 14:06, 7 September 2008 by Andr3w (talk | contribs) (→‎fillRect)
Jump to navigation Jump to search

The Graphics2D class is part of the Java library. It is documented at


The method fillRect(x,y,w,h) takes four parameters x,y (for the top left corner) and w,h for the width and height of the rectangle to be filled.

[Font] [Default] [Show] [Resize] [History] [Profile]


The method setColor determines the color used for following operation (such as fillRect). setColor takes a color as a parameter. Named Colors

You can use one of the standard colors such as Other colors include: black blue cyan darkGray gray green lightGray magenta orange pink red white yellow.

Custom Colors You can use one of the standard colors (such as or you can use a custom color using the constructor new Color(10,20,30) which uses red, green and blue components 10, 20, 30. Each component can be a value from 0 to 255.

[Font] [Default] [Show] [Resize] [History] [Profile]