Here you can find the source of paintRectCompartment(Graphics g, Dimension size, int x, int y, Color fillColor, Color strokeColor)
Paints the rectangle compartment at given coordinate with given fill color and stroke color.
Parameter | Description |
---|---|
g | the graphics to paint on |
size | the rectangle size |
x | x location of the rectangle |
y | y location of the rectangle |
fillColor | fill color |
strokeColor | stroke color |
static void paintRectCompartment(Graphics g, Dimension size, int x, int y, Color fillColor, Color strokeColor)
//package com.java2s; import java.awt.*; public class Main { /**//from w w w. j a va 2s .com * <p> * Paints the rectangle compartment at given coordinate with given fill color and stroke color. * </p> * @param g * the graphics to paint on * @param size * the rectangle size * @param x * x location of the rectangle * @param y * y location of the rectangle * @param fillColor * fill color * @param strokeColor * stroke color */ static void paintRectCompartment(Graphics g, Dimension size, int x, int y, Color fillColor, Color strokeColor) { g.setColor(fillColor); g.fillRect(x, y, size.width, size.height); g.setColor(strokeColor); g.drawRect(x, y, size.width, size.height); } }