Here you can find the source of setLeftPadding(JComponent component, int padding)
public static void setLeftPadding(JComponent component, int padding)
//package com.java2s; //License from project: Apache License import javax.swing.*; public class Main { public static final int DEFAULT_PADDING = 0; public static void setLeftPadding(JComponent component, int padding) { component.setBorder(// w w w.ja v a 2 s. c om BorderFactory.createEmptyBorder(DEFAULT_PADDING, padding, DEFAULT_PADDING, DEFAULT_PADDING)); } }