text = new JTextArea( rows, columns ); text.setEditable( false ); setLayout( new BorderLayout() ); add( new JScrollPane( text, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ), BorderLayout.CENTER );
Append String value to end of log Scroll area if necessary so that new text is visible. Scrolling is achieved by ensuring that the text caret is positioned at the end of the buffer. text.append( message ); text.setCaretPosition( text.getText().length() );
text.append( message ); text.setCaretPosition( text.getText().length() );