Java Utililty Methods Draw 3D Rectangle

List of utility methods to do Draw 3D Rectangle

Description

The list of methods to do Draw 3D Rectangle are organized into topic(s).

Method

voiddraw3DRect(Graphics g, int x, int y, int width, int height, boolean raise, int thickness)
Draw a 3D rectangle just like the draw3DRect() method of the AWT Graphics class but with the addition of a thickness parameter.
int w = width;
int h = height;
for (int i = 0; i < thickness; i++) {
    g.draw3DRect(x + i, y + i, w - 2 * i, h - 2 * i, raise);
voiddraw3DRect(Graphics g, int x, int y, int width, int height, int shadow, boolean raised)
draw D Rect
Color c = g.getColor();
Color brighter = c.brighter();
Color darker = c.darker();
g.setColor(raised ? brighter : darker);
for (int i = 0; i < shadow; i++) {
    g.drawLine(x + i, y + i, x + width - 1 - i, y + i);
    g.drawLine(x + i, y + i, x + i, y + height - 1 - i);
g.setColor(raised ? darker : brighter);
for (int i = 0; i < shadow; i++) {
    g.drawLine(x + i, y + height - 1 - i, x + width - 1 - i, y + height - 1 - i);
    g.drawLine(x + width - 1 - i, y + height - 1 - i, x + width - 1 - i, y + i);
g.setColor(c);
voiddraw3DRect(Graphics2D g, int x, int y, int width, int height, Dimension depth)
Draw a 3D Rect.
int p1x = x;
int p1y = y;
int p2x = x + width - 1;
int p2y = p1y;
int p3x = p2x;
int p3y = y + height - 1;
int p4x = x - depth.width + width - 1;
int p4y = y + depth.height + height - 1;
...