Here you can find the source of drawRect(Graphics g, int left, int top, int width, int height, int lineWidth)
Parameter | Description |
---|---|
g | _more_ |
left | _more_ |
top | _more_ |
width | _more_ |
height | _more_ |
lineWidth | _more_ |
public static void drawRect(Graphics g, int left, int top, int width, int height, int lineWidth)
//package com.java2s; /**/*w ww . j a va2 s .com*/ * Copyright (c) 2008-2015 Geode Systems LLC * This Software is licensed under the Geode Systems RAMADDA License available in the source distribution in the file * ramadda_license.txt. The above copyright notice shall be included in all copies or substantial portions of the Software. */ import java.awt.*; public class Main { /** * _more_ * * @param g _more_ * @param left _more_ * @param top _more_ * @param width _more_ * @param height _more_ * @param lineWidth _more_ */ public static void drawRect(Graphics g, int left, int top, int width, int height, int lineWidth) { left = left - lineWidth / 2; top = top - lineWidth / 2; width = width + lineWidth; height = height + lineWidth; for (int i = 0; i < lineWidth; i++) { g.drawRect(left, top, width, height); left = left + 1; top = top + 1; width = width - 2; height = height - 2; } } }