Creating a Scrollable JTable Component
// Create a table with 10 rows and 5 columns
JTable table = new JTable(10, 5);
// Make the table vertically scrollable
JScrollPane scrollPane = new JScrollPane(table);
// Disable auto resizing to make the table horizontal scrollable
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
Post a comment