Creating and Setting a line Border from BorderFactory : LineBorder « Swing « Java Tutorial






import java.awt.Color;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.border.LineBorder;

public class Main {
  public static void main(String[] argv) {
    LineBorder lineBorder = (LineBorder)BorderFactory.createLineBorder(Color.black);
    JLabel component = new JLabel("label");
    component.setBorder(lineBorder);

  }
}








14.100.LineBorder
14.100.1.LineBorder Class
14.100.2.LineBorder: color and widthLineBorder: color and width
14.100.3.Creating and Setting a line Border from BorderFactory