ntakouris
ntakouris

Reputation: 958

Java - Prevent Resize but keep adding text to JTextArea with JScrollPane

I have made a JTextArea in which I log some info(With an endless loop) I have already set the Preferred Size and added it to a JScrollPane. After logging messages reach the limit of the Jtextarea they stop printing on the screen . I want then to keep printing (and the scrollbar getting smaller and smaller), pretty much like a CMD prompt does. This is necessary because I already have another Jtextfield below and a button

Upvotes: 0

Views: 599

Answers (1)

Holger
Holger

Reputation: 298539

Don’t set a preferred size on the JTextArea. Set the preferred size of the JScrollPane instead.

Upvotes: 1

Related Questions