Creating a JScrollPane Container - Java Swing

Java examples for Swing:JScrollPane

Description

Creating a JScrollPane Container

Demo Code

import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class Main {

  public void main(String[] argv) {
    JTextArea textArea = new JTextArea(10, 10);
    JScrollPane scrollableTextArea = new JScrollPane(textArea);

    JList list = new JList();
    JScrollPane scrollableList = new JScrollPane(list);
  }/*from   w  w w  . j  a  v  a2  s .  c om*/
}

Related Tutorials