get Swing Text Area Scroll Pane Container - Java Swing

Java examples for Swing:JScrollPane

Description

get Swing Text Area Scroll Pane Container

Demo Code


//package com.java2s;

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

public class Main {
    public static JScrollPane getTextAreaScrollPaneContainer(
            JTextArea textArea, int nbLines) {
        JScrollPane ret = new JScrollPane();
        textArea.setRows(nbLines);//from   www.  j a  v a  2  s . c  o m
        textArea.setColumns(20);
        ret.setViewportView(textArea);
        return ret;
    }
}

Related Tutorials