Set JLabel Border - Java Swing

Java examples for Swing:JLabel

Description

Set JLabel Border

Demo Code


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);
        }
}

Related Tutorials