Java Swing Empty Border borderlessScrollPane(final Component component)

Here you can find the source of borderlessScrollPane(final Component component)

Description

Returns a new JScrollPane with the specified component and with an empty border.

License

Apache License

Parameter

Parameter Description
component the component to add to the scroll pane.

Return

a new scroll pane.

Declaration

public static JScrollPane borderlessScrollPane(final Component component) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import javax.swing.*;

import java.awt.*;

public class Main {
    /**/*w w w . ja  va  2  s.c  om*/
     * Returns a new JScrollPane with the specified component and with an empty border.
     *
     * @param component the component to add to the scroll pane.
     * @return a new scroll pane.
     */
    public static JScrollPane borderlessScrollPane(final Component component) {
        JScrollPane pane = new JScrollPane(component);
        pane.setBorder(BorderFactory.createEmptyBorder());
        return pane;
    }
}

Related

  1. addBorder(JComponent target, Border add)
  2. addBorderSpaces(JComponent com)
  3. addEmptyBorder(JComponent c, int i)
  4. addMarginAndBorder(JComponent component, int margin)
  5. blankBorder(int top, int left, int bottom, int right)
  6. buildInfoPanelEmptyBorderScroll(final JComponent content)
  7. buildPanelEmptyBorder(final JComponent content, final int top, final int left, final int bottom, final int right)
  8. contentPaneBorder(JComponent component)
  9. correctBorder(final JComponent comp)