Here you can find the source of scrollView(Component component, Border border)
public static JScrollPane scrollView(Component component, Border border)
//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; } }