I have a JavaFX TableView
and I would like the table behavior to truncate the image of the TableView
when the parent node resizes too small to display the data, instead of it becoming scrollable. To clarify, I just want the scroll bars disabled or not visible, so they don't show up.
Below is my node hierarchy in SceneBuilder in case that helps.
Things I've tried below
I read this post, but the answer just makes the cells resize to fit the width, instead of disabling the ScrollBar
. I read the documentation on ScrollBar
s here, but I couldn't find a visible
or enabled
property. I also read the TableView
documentation here with no luck.
I searched the JavaFX CSS guide here and found that there are the two policies below that can refer to a scroll pane.
-fx-hbar-policy:
-fx-vbar-policy:
But wrapping the TableView
in a ScrollPane
did not work as expected. It did not allow me to "fit-to-parent". I would like to refer to these properties, but in a TableView
directly if that's possible. Any suggestions are greatly appreciated.