Example usage for javax.swing JViewport add

List of usage examples for javax.swing JViewport add

Introduction

In this page you can find the example usage for javax.swing JViewport add.

Prototype

public Component add(String name, Component comp) 

Source Link

Document

Adds the specified component to this container.

Usage

From source file:test.uk.co.modularaudio.util.swing.dndtable.layeredpane.LaunchTestLayeredPaneDndTable.java

public JScrollPane getFrontScrollpane() throws DatastoreException {
    if (frontScrollpane == null) {
        frontScrollpane = new JScrollPane();
        frontScrollpane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        frontScrollpane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        frontScrollpane.getVerticalScrollBar().setUnitIncrement(16);
        frontScrollpane.setAutoscrolls(true);
        final JViewport viewport = frontScrollpane.getViewport();
        final JComponent fact = getFrontAudioComponentTable();
        viewport.add(fact, "grow");
    }/*  w w  w .  j  a  va 2 s . c o  m*/
    return frontScrollpane;
}