I am new to Java and I am building a tool which uses a JTable. I wanted to expand the column and shrink accordingly, as the user drags the column. I am not exactly sure about the term used for this. This behavior could be noticed in Windows Explorer as attached. How could this be achieved? Proper direction would be appreciated!!
JTable
JTable has the setAutoResizeMode, to resize all columns you can use AUTO_RESIZE_ALL_COLUMNS.
myTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
2.1m questions
2.1m answers
60 comments
57.0k users