Set Column Width of JTable by Percentage
问题 I need to assign a fixed width to a few columns of a JTable and then an equal width to all the other columns. Suppose a JTable has 5 columns. The first column should have a width of 100 and the second one a width of 150. If the remaining width of the JTable is 600 after setting the width of the two columns, I'd like to evenly split it among the other three columns. The problem is table.getParent().getSize().width is often 0, even if it is added to the JFrame and visible, so I can't use it as