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

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

Description

draw Rect

License

Open Source License

Declaration

private static void drawRect(Graphics g, int x, int y, int w, int h) 

Method Source Code

//package com.java2s;
import java.awt.*;

public class Main {
    private static void drawRect(Graphics g, int x, int y, int w, int h) {
        g.fillRect(x, y, w + 1, 1);/*w  w w .  java 2 s. com*/
        g.fillRect(x, y + 1, 1, h);
        g.fillRect(x + 1, y + h, w, 1);
        g.fillRect(x + w, y + 1, 1, h);
    }
}

Related

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