Java Paint Rectangle paintBackgroundRow(Graphics g, Rectangle rectangleArea)

Here you can find the source of paintBackgroundRow(Graphics g, Rectangle rectangleArea)

Description

paint Background Row

License

Contributor Agreement License

Declaration

public static void paintBackgroundRow(Graphics g, Rectangle rectangleArea) 

Method Source Code


//package com.java2s;
/*//  w  w  w  .  java 2 s.co m
 * @(#) GUIUtils
 *
 * Copyright (C) 2007 Pingtel Corp., certain elements licensed under a Contributor Agreement.  
 * Contributors retain copyright to elements licensed under a Contributor Agreement.
 * Licensed to the User under the LGPL license.
 *
 */

import java.awt.*;

public class Main {
    public static void paintBackgroundRow(Graphics g, Rectangle rectangleArea) {
        // store current color whatever it is
        Color tmpColor = g.getColor();

        // set the background color (determined by experimentation)
        g.setColor(new Color(20, 18, 20));

        // fill the background with the color
        g.fillRect(rectangleArea.x, rectangleArea.y, rectangleArea.width, rectangleArea.height);

        // reset to original color
        g.setColor(tmpColor);
    }
}