Java Swing: Automatically Resize Table Columns

When you use JTables in Swing, you will notice that by default, all columns have the same size. The programmer can decide to set a specific width on each column, but he does not always know what kind of data will show up in the table and what width is required for each column. This video provides the code for an easy solution to this problem, automatically resizing table columns based on the data in the table.

Video Source and Code: http://bosmeeuw.wordpress.com/2011/08/07/java-swing-automatically-resize-table-columns-to-their-contents/