Java tutorial
//package com.java2s; import java.awt.Color; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.border.Border; public class Main { /** * Adds a basic black line border around the given component. * @param c - the component to put the border around */ public static void addLineBorder(JComponent c) { Border lineBorder; lineBorder = BorderFactory.createLineBorder(Color.black); c.setBorder(lineBorder); } }