Here you can find the source of drawSquareBorder(Graphics2D g, int x, int y, int width, int height, int rounding, Color color, float strokeWidth)
public static void drawSquareBorder(Graphics2D g, int x, int y, int width, int height, int rounding, Color color, float strokeWidth)
//package com.java2s; import java.awt.*; public class Main { public static void drawSquareBorder(Graphics2D g, int x, int y, int width, int height, int rounding, Color color, float strokeWidth) { Stroke stroke = g.getStroke(); g.setColor(color);//from w w w.j a v a 2 s. co m g.setStroke(new BasicStroke(strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); g.drawRect(x, y, width, height); g.setStroke(stroke); } }