Here you can find the source of drawDisabledBorder(Graphics g, int x, int y, int w, int h)
static void drawDisabledBorder(Graphics g, int x, int y, int w, int h)
//package com.java2s; /*/*from w ww .j av a 2 s. co m*/ * SmoothGradientUtils.java * * Copyright (C) 2002-2015 Takis Diakoumis * * 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 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/>. * */ import java.awt.Graphics; import javax.swing.plaf.metal.MetalLookAndFeel; public class Main { static void drawDisabledBorder(Graphics g, int x, int y, int w, int h) { g.setColor(MetalLookAndFeel.getControlShadow()); drawRect(g, x, y, w - 1, h - 1); } /** * An optimized version of Graphics.drawRect. */ private static void drawRect(Graphics g, int x, int y, int w, int h) { g.fillRect(x, y, w + 1, 1); g.fillRect(x, y + 1, 1, h); g.fillRect(x + 1, y + h, w, 1); g.fillRect(x + w, y + 1, 1, h); } }