开发者

Window Focus and TextArea text append

I have a logging window in my application. The messages are written to the JTextA开发者_StackOverflow社区rea 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜