Enable word-wrapping
import javax.swing.JTextArea; public class Main { public static void main(String[] argv) { JTextArea c = new JTextArea(); c.setLineWrap(true); c.setWrapStyleWord(true); } }