Java Utililty Methods Swing Empty Border

List of utility methods to do Swing Empty Border

Description

The list of methods to do Swing Empty Border are organized into topic(s).

Method

voidpadBorder(JComponent component, int top, int left, int bottom, int right)
pad Border
component.setBorder(
        BorderFactory.createCompoundBorder(blankBorder(top, left, bottom, right), component.getBorder()));
voidremoveBorder(JComponent component)
remove Border
component.setBorder(BorderFactory.createEmptyBorder());
JScrollPanescrollView(Component component, Border border)
scroll View
JScrollPane scroll = new JScrollPane();
if (border != null)
    scroll.setBorder(border);
scroll.setViewportView(component);
return scroll;
voidsetEmptyBorder(int top, int left, int bottom, int right, JComponent... components)
Set the border of the given components to an empty border with the given margins.
setBorder(BorderFactory.createEmptyBorder(top, left, bottom, right), components);
voidsetStandardBorder(JComponent aComponent)
Sets a standard border of the given component.
final int bs = BORDER_SIZE;
aComponent.setBorder(BorderFactory.createEmptyBorder(bs, bs, bs, bs));
BorderspacingBorder()
spacing Border
return BorderFactory.createEmptyBorder(spacing, spacing, spacing, spacing);
JComponentwrapEmptyBorder(Component content, int top, int left, int bottom, int right)
wrap Empty Border
return wrapBorder(content, BorderFactory.createEmptyBorder(top, left, bottom, right));