Here you can find the source of setEmptyBorder(JButton button, int paddingTop, int paddingLeft, int paddingBottom, int paddingRight)
public static void setEmptyBorder(JButton button, int paddingTop, int paddingLeft, int paddingBottom, int paddingRight)
//package com.java2s; //License from project: Apache License import javax.swing.*; import javax.swing.border.Border; public class Main { public static void setEmptyBorder(JButton button, int paddingTop, int paddingLeft, int paddingBottom, int paddingRight) { if (button != null) { Border emptyBorder = BorderFactory.createEmptyBorder(paddingTop, paddingLeft, paddingBottom, paddingRight);//from w ww . j a v a 2 s .c o m button.setBorder(emptyBorder); } } }