Why isn't the JTable resizing properly?

Solution 1:

Basically, as you are using JScrollPane container for your JTable, you only need to add the scrollPane in your centerPanel, and make sure to add it in the CENTER. The below resolves the issue in your code.

this.table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
//this.centerPanel.add(table, BorderLayout.CENTER);

this.scrollPane = new JScrollPane(this.table);
this.centerPanel.add(scrollPane, BorderLayout.CENTER);