Java tutorial
//package com.java2s; //License from project: Open Source License 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))); } }