No, you cannot set the width of the BevelBorder . A BevelBorder simply draws two 1px lines on the edge - one for the outer shadow and one for the inner shadow. Unfortunately, just calling setStroke will not work, because on each corner one color will simply overlap the other, and this will lead to other unpleasant visual effects.
Also, what you seem to be asking is not really a BevelBorder . This is a border with 5 color specifications: top, right, bottom, left and line color. A BevelBorder does not have line color, nor does it have such color characteristics.
I created a class extending AbstractBorder that should meet your requirements:

import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.Point; import java.awt.Polygon; import java.awt.RenderingHints; import javax.swing.border.AbstractBorder; public class AdvancedBevelBorder extends AbstractBorder { private Color topColor, rightColor, bottomColor, leftColor, lineColor; private int borderWidth; public AdvancedBevelBorder(Color topColor, Color rightColor, Color bottomColor, Color leftColor, Color lineColor, int borderWidth) { setTopColor(topColor); setRightColor(rightColor); setBottomColor(bottomColor); setLeftColor(leftColor); setLineColor(lineColor); setBorderWidth(borderWidth); } @Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { super.paintBorder(c, g, x, y, width, height); int h = height; int w = width; int bw = getBorderWidth(); Graphics2D g2 = (Graphics2D) g.create(); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.translate(x, y); Polygon topPolygon = createPolygon(new Point(0, 0), new Point(w, 0), new Point(w - bw, bw), new Point(bw, bw), new Point(0, 0)); g2.setColor(getTopColor()); g2.fill(topPolygon); g2.setColor(getLineColor()); g2.draw(topPolygon); Polygon rightPolygon = createPolygon(new Point(w - 1, 0), new Point(w - 1, h), new Point(w - bw - 1, h - bw), new Point(w - bw - 1, bw), new Point(w - 1, 0)); g2.setColor(getRightColor()); g2.fill(rightPolygon); g2.setColor(getLineColor()); g2.draw(rightPolygon); Polygon bottomPolygon = createPolygon(new Point(0, h - 1), new Point(w, h - 1), new Point(w - bw, h - bw - 1), new Point(bw, h - bw - 1), new Point(0, h - 1)); g2.setColor(getBottomColor()); g2.fill(bottomPolygon); g2.setColor(getLineColor()); g2.draw(bottomPolygon); Polygon leftPolygon = createPolygon(new Point(0, 0), new Point(0, h), new Point(bw, h - bw), new Point(bw, bw), new Point(0, 0)); g2.setColor(getLeftColor()); g2.fill(leftPolygon); g2.setColor(getLineColor()); g2.draw(leftPolygon); g2.dispose(); } @Override public Insets getBorderInsets(Component c) { return new Insets(getBorderWidth(), getBorderWidth(), getBorderWidth() + 1, getBorderWidth() + 1); } private Polygon createPolygon(Point... points) { Polygon polygon = new Polygon(); for (Point point : points) { polygon.addPoint(point.x, point.y); } return polygon; } public Color getTopColor() { return topColor; } public void setTopColor(Color topColor) { this.topColor = topColor; } public Color getRightColor() { return rightColor; } public void setRightColor(Color rightColor) { this.rightColor = rightColor; } public Color getBottomColor() { return bottomColor; } public void setBottomColor(Color bottomColor) { this.bottomColor = bottomColor; } public Color getLeftColor() { return leftColor; } public void setLeftColor(Color leftColor) { this.leftColor = leftColor; } public Color getLineColor() { return lineColor; } public void setLineColor(Color lineColor) { this.lineColor = lineColor; } public int getBorderWidth() { return borderWidth; } public void setBorderWidth(int borderWidth) { this.borderWidth = borderWidth; } }
By the way, I made the component that you see in the image with the following code:
AdvancedBevelBorder border = new AdvancedBevelBorder(new Color(120, 172, 220), new Color(55, 93, 128), new Color(73, 124, 169), new Color(150, 191, 229), new Color(36, 83, 126), 10); JPanel panel = new JPanel() { @Override public Dimension getPreferredSize() { return new Dimension(200, 60); } }; panel.setBackground(new Color(91, 154, 212)); panel.setBorder(border);