JScrollPane does not resize

From: Tarlika Elisabeth Schmitz (mail_at_cranntara.net)
Date: 05/29/04


Date: Sat, 29 May 2004 17:14:22 +0100

Hello,

I display a JTextArea in a JScrollPane.

jTextArea.setColumns(col) does not cause the scrollpane to resize
automatically. I checked the jTextArea's preferredSize before and after
the setColumns() call - the width does change.
But it is not until I explicitly execute jPane.setPreferredSize() that
the resize takes effect.

I tried invalidate() on the textarea, the viewport and the scrollpane -
to no avail.

Any ideas input is most welcome.

Regards,
Tarlika Elisabeth Schmitz



Relevant Pages