I am using a TableView in a ScrollPane. The contents is large
enough to need
a vertical scrollbar. Even though the width of the TableView is
resizing to
accomodate it's contents there is still a horizontal scroll bar
appearing that
pretty much scrolls the distance that the vertical scroll bar is
taking up. Is
there any way I can get the ScrollPane to increase it's width when
adding a
vertical scroll bar rather than taking up the TableView space?
There really isn't any way to make a ScrollPane increase its own
width, since that is up to the scroll pane's parent. However, you
might try setting the horizonalScrollBarPolicy to FILL or
FILL_TO_CAPACITY to see if that meets your needs. FILL means - "always
make the view the same width as the scroll pane". FILL_TO_CAPACITY
means "make the view the same width as the scroll pane until its
preferred width exceeds the width of the scroll pane. The default is
AUTO, which means "show a horizontal scroll bar if the view's
preferred width exceeds the width of the scroll pane; otherwise, hide
it".
Oh and it would be a very cool thing if the TableView could support
automatic
widths :-)
By "automatic", do you mean "size to fit"? In other words, make the
column width the max. width of all the cells in a particular column?
If so, we don't currently support that. We could conceivably do so by
supporting a value of -1 for column width (like TablePane columns),
but we didn't think there was a strong use case for that. TablePanes
generally have a small number of rows, so calculating this width
doesn't impose a performance penalty. However, TableViews are intended
to display a large number of rows and it could be costly to determine
this value.
On the other hand, if you know you are only going to have a small
number of rows in your TableView, it might be a useful feature. Please
feel free to submit a feature request for this (in JIRA).
Greg