add JComponent Border Spaces - Java Swing

Java examples for Swing:JComponent

Description

add JComponent Border Spaces

Demo Code


//package com.java2s;

import javax.swing.BorderFactory;
import javax.swing.JComponent;

public class Main {
    public static void addBorderSpaces(JComponent com) {
        com.setBorder(BorderFactory.createCompoundBorder(com.getBorder(),
                BorderFactory.createEmptyBorder(2, 4, 2, 4)));
    }//  ww w . j a va 2  s. co  m
}

Related Tutorials