Java Swing Empty Border scrollView(Component component, Border border)

Here you can find the source of scrollView(Component component, Border border)

Description

scroll View

License

Apache License

Declaration

public static JScrollPane scrollView(Component component, Border border) 

Method Source Code

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

import java.awt.Component;

import javax.swing.BorderFactory;

import javax.swing.JScrollPane;

import javax.swing.border.Border;

public class Main {
    public static JScrollPane scrollView(Component component) {
        JScrollPane scroll = new JScrollPane();
        scroll.setBorder(BorderFactory.createEmptyBorder());
        scroll.setViewportView(component);
        return scroll;
    }// w  w w  .  j a va2  s  . com

    public static JScrollPane scrollView(Component component, Border border) {
        JScrollPane scroll = new JScrollPane();
        if (border != null)
            scroll.setBorder(border);
        scroll.setViewportView(component);
        return scroll;
    }
}

Related

  1. getEmptyBorder(int width)
  2. getRaisedBorder(int innerPadding)
  3. makeEmptyBorderResource(int top, int left, int bottom, int right)
  4. padBorder(JComponent component, int top, int left, int bottom, int right)
  5. removeBorder(JComponent component)
  6. setEmptyBorder(int top, int left, int bottom, int right, JComponent... components)
  7. setStandardBorder(JComponent aComponent)
  8. spacingBorder()
  9. wrapEmptyBorder(Component content, int top, int left, int bottom, int right)