How to restore column widths in a JTable?
问题 My question is clear. Is there any way to restore the width of the columns automatically after user has resized them? Every time the button is clicked, I want the column widths to be restored. public class TableTest { public static void main(String[] args) { SwingUtilities.invokeLater(() -> { JFrame frame = new JFrame(""); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout()); JTable table = new JTable(new Object[][] { { "something", "something else" } },