Use JTextArea's read method rather than manually.