Java JScrollPane Scroll scrollView(Component component)

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

Description

scroll View

License

Apache License

Declaration

public static JScrollPane scrollView(Component component) 

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;
    }//from w w  w .j av a2s . co m

    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. scrollRectToVisible(Component component, Rectangle aRect)
  2. scrollToComponent(Component cmp)
  3. scrollToVisible(int row, int col)
  4. scrollV(String title, JComponent content)
  5. scrollVertically(JComponent c, Rectangle r)