Re: automatically maximize JTable?



matomira@xxxxxxx wrote:
> I see questions everywhere on the web about how to fit a JTable to take
> all available space, but no adequate answer.

Then ask more specifically (code!). I cannot even determine whether your
problem is width or height.


> A JList with JScrollPanel in the same place has no problem resizing
> properly.


JTable JList (VERTICAL)
---------------------------------------------------------------------------------------------------------
minimum width sum of columns' /
preferred width sum of columns' | fixed, or maximum of renderers' preferred width
maximum width sum of columns' \

minimum/preferred/ \ sum of row heights rowCount * fixed height, or sum of renderer's
maximum width / preferred heights


preferredScrollable- explicitly set = preferred width
Viewport width (default: 450)

underflows width iff AUTO_RESIZE_OFF false
shrinks width to viewport unless AUTO_RESIZE_OFF false


preferredScrollable- explicitly set visibleRowCount (default: 8) [1]
Viewport height (default: 400) * (fixed cell size, or first cell's size)

underflows height true[2] false
shrinks height to viewport false false



[1] even probably wrongly implemented (if only one of fixedCellWidth/Height
is set, it is ignored).
[2] this has no effect on layout, only on whether the area below the cells
is filled by JTable background or JViewport background color.



Christian
--
And in short, I was afraid.
.