Example usage for javax.swing JScrollPane JScrollPane

List of usage examples for javax.swing JScrollPane JScrollPane

Introduction

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

Prototype

public JScrollPane(int vsbPolicy, int hsbPolicy) 

Source Link

Document

Creates an empty (no viewport view) JScrollPane with specified scrollbar policies.

Usage

From source file:AddCheckBoxAction.java

public static void main(String[] args) {
    CheckBoxPanel chD = new CheckBoxPanel();
    JFrame mainFrame = new JFrame();
    JScrollPane scrollP = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    scrollP.setViewportView(chD);//  w w  w.  jav a 2s.co m
    mainFrame.setSize(320, 200);
    mainFrame.getContentPane().add(scrollP);

    mainFrame.setVisible(true);
}