aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Changing Number of Column in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Changing Number of Column in JTable" Watch "Changing Number of Column in JTable" New topic

Changing Number of Column in JTable

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I would like to load number of column in JTable dynamically and i would like to change the name of the each column dynamically. Could any one can help me out.
Thanks in advance,
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
the TableModel should do what you want. you will have to write your own (that implements the interface TableModel) and provide an appropriate method that returns dynamically the column names. maybe, you'll have to fire an event to update the table.
It is sorta covered in the JavaRanch Style Guide.
subject: Changing Number of Column in JTable