Set your JTextArea to automatically wrap at a word boundary as in thefollowing snippet:JTextArea myTextArea = new JTextArea();myTextArea.setLineWrap(true);myTextArea.setWrapStyleWord(true);