• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inserting a Column in JTable  RSS feed

 
The Verb
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I add a column to it, and it's default position is to the end. That's alright, i'll use the move column method to move it to the position i want, that works fine... for the first one, when i add a second, using exactly the same process, the one i previously added moves to the end and my new column gets inserted in the wrong place!
Any Ideas? or has someone managed to get this working that i could have a look at their code?
Thanks
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just a stupid question: do you really have to add the columns one after another? and are you using a TableModel?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"The Verb" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

Thanks! and welcome to the JavaRanch!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!