So I\'m stumped. I, for some reason, seem to remember that Java does weird things when you try to add new lines to stuff... so I think that may be the problem here.
Thi
I'm not sure I understand what you are trying to do, all I know is that you are using the wrong approach. You should NOT be using a KeyListener.
From what I can see you want the contents of the output text area to be the same as the contents of the input area. If this is your requirement then you just use:
JTextArea input = new JTextArea(...);
JTextArea output = new JTextArea(...);
output.setDocument( input.getDocument() );
Or if you are trying to listen for all the changes to the input text area then you should be using a DocumentListener. The Swing tutorial has a section titled "How to Write a Document Listener" for more information.