Here you can find the source of drawEtchedBorder(Graphics g, int x, int y, int width, int height, Color dark, Color bright)
public static final void drawEtchedBorder(Graphics g, int x, int y, int width, int height, Color dark, Color bright)
//package com.java2s; //License from project: Apache License import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; public class Main { public static final void drawEtchedBorder(Graphics g, int x, int y, int width, int height, Color dark, Color bright) { g.translate(x, y);/*from www . j a v a 2 s . c o m*/ g.setColor(dark); g.drawRect(0, 0, width - 2, height - 2); g.setColor(bright); g.drawLine(1, height - 3, 1, 1); g.drawLine(1, 1, width - 3, 1); g.drawLine(0, height - 1, width - 1, height - 1); g.drawLine(width - 1, height - 1, width - 1, 0); g.translate(-x, -y); } public static final void drawEtchedBorder(Graphics g, Rectangle r, Color dark, Color bright) { drawEtchedBorder(g, r.x, r.y, r.width, r.height, dark, bright); } }