Being Nice to your Layout manager - Is this the right way?
Ive written a custom component that basically provides multi-line text wrapping and a few other nice things.
I had a bit of trouble when I came to implementing
getPreferredSize() getMinimumSize()
This is because ideally, I'd like the component to use as much space horizontally as possible, whilst using only as much vertical space as necessary.
To do this, I used the parents width as the minimum horizontal size. This then allowed me to work out the height.
Question is - is that the right way to do it? Other than that, I just cant think of a way to get the width I need when the component is first added to its container.
Cheers for any input,
Dave

