Reputation: 16319
I have a JTable of 25 columns, composed using the netbeans GUI builder. I'd like for the GUI to display maybe 5 columns, and have a scrollbar for users to scroll through the remaining columns. Any ideas on how to do this?
Screenshot attached shows 25 column table trying to be rendered to show all 25 columns (ugly mess).
Upvotes: 0
Views: 567
Reputation: 347334
Start by having a look at JTable#setAutoResizeMode
In your case, you could use JTable.AUTO_RESIZE_OFF
See How to Use Tables for more details
Upvotes: 2