tags:

views:

29

answers:

1

I have a logging window in my application. The messages are written to the JTextArea inside this window.

JFrame -> JScrollPane -> JTextArea

Code that writes the messages:

LogTextArea.append(message + "\n");

If I have this log window open, whenever something writes a message to this window, the window automatically gets pushed to the top and focused.

For example, I have a form window open and Im filling out information. A message is written to the log window. When the message is written, the Log window gets focused and I can't type in the form I was filling out anymore.

How can I stop this from happening?

+1  A: 

Here's an example using append() that does not exhibit this behavior. You might compare it with your own code for differences.

trashgod