AutoResize « JTable « Java Swing Q&A





1. JTable autoresize, with a twist?    stackoverflow.com

This is a well known autoresizer for JTable :

public JTable autoResizeColWidth(JTable table, DefaultTableModel model) {
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        ...

2. How to make JTable both AutoResize and horizontall scrollable?    stackoverflow.com

I am putting a JTable into a JScrollPane But When I set JTable Auto Resizeable, then it won't have horizontal scroll bar. if I set AUTO_RESIZE_OFF, then the Jtable won't fill the width ...