Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to add Columns dynamically to JTable

 
Vasu Reddy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need some idea to add number of columns dynamically.

My application gets data by querying, the no of columns per query are not same. Some results need 5 columns, and other needs 12,....

How to add number of columns to ColumnHeader dynamically.

Thanks in advance,

Regards,
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are your queries so similar that it's just a matter of adding columns? I would have expected that you would have to create a new TableModel as the result of a different query, at the very least. Then perhaps some tweaking of renderers, editors and Column settings...
 
Vasu Reddy
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff,

Yes you are right, and thanks for your idea. I will try this way.

Thank you,

Vasu Reddy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic