TextArea in JScrollPane extends, not shrinks

M

Miguel De Anda

This is kinda strange, I was making a very simple "notepad" to use in a
larger application and I ran into this strange problem. When the window
(JFrame or JInternalFrame with a JScrollPane with a JTextArea inside of it)
gets resized, the TextArea object grows, but doesn't shrink. The way I know
this is that if I expand it horizontally, it does as expected, it allows for
more text. If, however, I shrink the window horizontally, I immediately get
a horizontal scrollbar, even if there is not text to the right. I've noticed
that I get this problem with most objects inside of the scroll pane. How can
I fix this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top