Creating and Setting an Empty Border from BorderFactory : EmptyBorder « Swing « Java Tutorial






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

public class Main {
  public static void main(String[] argv) {
    EmptyBorder emptyBorder = (EmptyBorder) BorderFactory.createEmptyBorder();
    JLabel component = new JLabel("label");
    component.setBorder(emptyBorder);

  }
}








14.105.EmptyBorder
14.105.1.Empty BorderEmpty Border
14.105.2.Creating Empty using its ConstructorCreating Empty using its Constructor
14.105.3.Adding EmptyBorder to a JButtonAdding EmptyBorder to a JButton
14.105.4.Creating and Setting an Empty Border from BorderFactory