Here you can find the source of getTextAreaScrollPaneContainer(JTextArea textArea, int nbLines)
public static JScrollPane getTextAreaScrollPaneContainer(JTextArea textArea, int nbLines)
//package com.java2s; //License from project: Apache License import javax.swing.*; public class Main { public static JScrollPane getTextAreaScrollPaneContainer(JTextArea textArea, int nbLines) { JScrollPane ret = new JScrollPane(); textArea.setRows(nbLines);// ww w . ja va2 s . c o m textArea.setColumns(20); ret.setViewportView(textArea); return ret; } }