List of utility methods to do Swing Empty Border
void | addBorder(JComponent target, Border add) add Border addBorder(target, add, false); |
void | addBorderSpaces(JComponent com) add Border Spaces com.setBorder( BorderFactory.createCompoundBorder(com.getBorder(), BorderFactory.createEmptyBorder(2, 4, 2, 4))); |
void | addEmptyBorder(JComponent c, int i) add Empty Border addOuterBorder(c, BorderFactory.createEmptyBorder(i, i, i, i)); |
Border | addMarginAndBorder(JComponent component, int margin) Add a margin and border to a given component Border marginBorder = BorderFactory.createEmptyBorder(margin, margin, margin, margin);
Border etchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
Border compoundBorder = BorderFactory.createCompoundBorder(etchedBorder, marginBorder);
component.setBorder(compoundBorder);
return compoundBorder;
|
Border | blankBorder(int top, int left, int bottom, int right) Get a border consisting of empty space. return BorderFactory.createEmptyBorder(top, left, bottom, right);
|
JScrollPane | borderlessScrollPane(final Component component) Returns a new JScrollPane with the specified component and with an empty border. JScrollPane pane = new JScrollPane(component); pane.setBorder(BorderFactory.createEmptyBorder()); return pane; |
JComponent | buildInfoPanelEmptyBorderScroll(final JComponent content) build Info Panel Empty Border Scroll final JPanel result = new JPanel(new BorderLayout()); result.setBorder(BorderFactory.createEmptyBorder()); final JScrollPane scroll = new JScrollPane(content); result.add(scroll, BorderLayout.CENTER); return result; |
JComponent | buildPanelEmptyBorder(final JComponent content, final int top, final int left, final int bottom, final int right) build Panel Empty Border final JPanel result = new JPanel(new BorderLayout()); result.setBorder(BorderFactory.createEmptyBorder(top, left, bottom, right)); result.add(content, BorderLayout.CENTER); return result; |
JComponent | contentPaneBorder(JComponent component) content Pane Border return border(component, 5, TOP | LEFT | BOTTOM | RIGHT);
|
void | correctBorder(final JComponent comp) Called for each tab panel component that is derived from a JComponent. if (comp != null) { Border border = comp.getBorder(); if (border == null) { border = BorderFactory.createEmptyBorder(7, 7, 7, 7); } else if (border instanceof EmptyBorder == false && (border instanceof CompoundBorder == false || ((CompoundBorder) border).getOutsideBorder() instanceof EmptyBorder == false)) { border = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7), border); comp.setBorder(border); |