Java Draw Rectangle drawThickRect(Graphics g, int x, int y, int w, int h, int d)

Here you can find the source of drawThickRect(Graphics g, int x, int y, int w, int h, int d)

Description

draw Thick Rect

License

Open Source License

Declaration

public static void drawThickRect(Graphics g, int x, int y, int w, int h, int d) 

Method Source Code

//package com.java2s;
/*************************************************************************
 * Clus - Software for Predictive Clustering                             *
 * Copyright (C) 2007                                                    *
 *    Katholieke Universiteit Leuven, Leuven, Belgium                    *
 *    Jozef Stefan Institute, Ljubljana, Slovenia                        *
 *                                                                       *
 * This program is free software: you can redistribute it and/or modify  *
 * it under the terms of the GNU General Public License as published by  *
 * the Free Software Foundation, either version 3 of the License, or     *
 * (at your option) any later version.                                   *
 *                                                                       *
 * This program is distributed in the hope that it will be useful,       *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 * GNU General Public License for more details.                          *
 *                                                                       *
 * You should have received a copy of the GNU General Public License     *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. *
 *                                                                       *
 * Contact information: <http://www.cs.kuleuven.be/~dtai/clus/>.         *
 *************************************************************************/

import java.awt.*;

public class Main {
    public static void drawThickRect(Graphics g, int x, int y, int w, int h, int d) {
        g.fillRect(x, y, w, d);/*from w w w.j  a v a 2 s  .co m*/
        g.fillRect(x, y + d, d, h - 2 * d);
        g.fillRect(x, y + h - d, w, d);
        g.fillRect(x + w - d, y + d, d, h - 2 * d);
    }
}

Related

  1. drawRect(Graphics g, Rectangle r)
  2. drawRect(Rectangle r, Graphics2D g)
  3. drawRectOrOval(Graphics2D g, boolean oval, int arc, int x, int y, int width, int height)
  4. drawRectPlot(Graphics2D g, int x, int y, int size)
  5. drawRoundRect(Graphics g, int left, int top, int width, int height, int arcWidth, int arcHeight, int lineWidth)
  6. drawThickRect(Graphics g, int x, int y, int width, int height, int thickness)