Here you can find the source of setCeil(final JTextArea textArea)
public static void setCeil(final JTextArea textArea)
//package com.java2s; //License from project: Apache License import java.awt.Point; import javax.swing.JTextArea; import javax.swing.JViewport; import javax.swing.SwingUtilities; public class Main { public static void setCeil(final JTextArea textArea) { SwingUtilities.invokeLater(new Runnable() { public void run() { JViewport v = (JViewport) textArea.getParent(); v.setViewPosition(new Point(0, 0)); }/*from w w w .j a v a 2 s .c o m*/ }); } }