Java examples for Swing:JLabel
Set JLabel Border
import java.awt.Color; import javax.swing.BorderFactory; import javax.swing.JApplet; import javax.swing.JLabel; import javax.swing.border.Border; public class Main { public void init(){ JLabel label1 = new JLabel("JLabel Create Border Example."); // www .ja va 2s . c o m Border border = BorderFactory.createLineBorder(Color.blue); label1.setBorder(border); } }