D
D
dayz7772014-10-11 18:30:05
Java
dayz777, 2014-10-11 18:30:05

How to output text sequentially on a JFrame?

I have JFrame. And I need to sequentially output lines of text to frame as a result of my program. Each entry on a new line. That is, it turns out something like a log of the application. How can I do that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Odissey Nemo, 2014-10-28
@odissey_nemo

Link to Java text components tutorial . I have used JTextArea for similar purposes . For splitting by lines I use txtArea.getText() + '\n' + "Тест новой строки";(this is just an example).
It is not very convenient to update the entire text in front of the computer, adding a new line to the common buffer of the previous text, but there is nothing simpler in Java. You can, however, organize the elimination of previous lines so that the displayed buffer does not become too large.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question