Java examples for 2D Graphics:Rectangle
fill Rectangle
//package com.java2s; import java.awt.Color; import java.awt.Graphics; public class Main { public static void fillRect(Graphics offLineBuffer, Color color, int x, int y, int width, int height) { offLineBuffer.setColor(color);/* w w w .j a v a 2 s . com*/ offLineBuffer.fillRect(x, y, width, height); } }