Knute Johnson wrote:
<<<Klu>>> wrote:
> I want, in other words, to simply be able to specify the text to
display
and have everything work, without needing to specify a magic number
somewhere else (such as with setRows) that has to be kept in synch
with that text for things to work.
Layout managers were supposed to save us from this kind of thing.
I want ice cream but I'm not getting it. If you want a JTextArea to
lay out easily, set the rows and columns and quit arguing about it.
And learn how to use GridBagLayout, once you do it will save you
unending grief.
How rude.
I want a JTextArea to lay out easily automatically, without me,
personally, having to count characters and/or experiment to find the
right magic numbers to plug in somewhere. If I wanted to do that I'd
use setLayout(null) and absolute positioning like it was mid-1990s
Visual Basic code I was writing.
The JTextArea should be able to compute its own number of rows from
the text, wrap policy, and number of columns. This should be obvious,
even to someone in grade school once he's told what a JTextArea is.
As for GridBagLayout, I don't see how it would help here. The problem
is a component misreporting its preferred size. That will screw up any
layout manager that has to deal with that component.
bug, and again here.