How to create a scrollable JTable component?
To create a scrollable
JTable component we have to use a
JScrollPane as the container of the
JTable. Beside that we also need to set the table auto resize mode to
JTable.AUTO_RESIZE_OFF so that a horizontal scroll bar displayed by the scroll pane when needed. If we do not turn off the auto resize mode the colums of the table will be resized to fit the available window size.