Java tutorial
import javax.swing.JButton; import javax.swing.JOptionPane; public class Main { public static void main(final String args[]) { JButton button = new JButton(); // Get gap size; default is 4 int gapSize = button.getIconTextGap(); // Set gap size button.setIconTextGap(8); JOptionPane.showMessageDialog(null, button); } }