Adam Hughes
Adam Hughes

Reputation: 16319

JTable in netbeans: how do display table of many columns

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).enter image description here

Upvotes: 0

Views: 567

Answers (1)

MadProgrammer
MadProgrammer

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

Related Questions