import javax.swing.border.Border; static JPanel withBlackBorder(Component c) { ret withBorder(BorderFactory.createLineBorder(Color.black), c); } static BufferedImage withBlackBorder(int width default 1, BufferedImage img) { ret addBorderToImage(Color.black, width, img); }