P
P
Proffik2014-10-09 20:05:05
Java
Proffik, 2014-10-09 20:05:05

How to make messages appear one below the other in chat in Java?

Hello. I'm writing a Java application in Swing, how can I make the messages appear one below the other?
Example:
Jimm: Hi.....
Kim: Hi...
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pi314, 2014-10-09
@Proffik

If, according to the condition of the problem, we must telepathically find out what, where and how exactly is displayed in this application, then I would venture to offer an answer: we need to add a "line feed" to the end of the added line.
You can do it like this (correctly):
or like this (obviously):
myJTextArea.append(myString + "\n");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question