Java JComponent Padding setLeftPadding(JComponent component, int padding)

Here you can find the source of setLeftPadding(JComponent component, int padding)

Description

set Left Padding

License

Apache License

Declaration

public static void setLeftPadding(JComponent component, int padding) 

Method Source Code


//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));
    }
}

Related

  1. addPadding(JComponent comp, int topbottom, int leftright)
  2. makePaddedPanel(JComponent aComponent, Insets aInsets)
  3. pad(JComponent component, int w, int h)
  4. paint(JComponent jc, int padding)
  5. setComponentHeight(JComponent setme, JComponent getme, int padding)