Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

hiding the column  RSS feed

 
Mikesh John
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need your help in hiding the column but not removing , because i need to bring this coulumn id to the next screen, only i donot want to show the column but internally it has to take the value to naviagate the screen, but if i use below code, i am getting null pointer exception, can you please help on this.column.setMinWidth(0);column.setMaxWidth(0); column.setWidth(0); column.setPreferredWidth(0)
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use JTable#removeColumn(TableColumn column)
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i donot want to show the column but internally it has to take the value to naviagate the screen,


All Swing components work with a "Model" (to hold the data) and a "View" (to display the data).

When you use the removeColum(...) method as suggested by Maneesh the column is just removed from the view, but the data is still available in the TableModel. To access the data you just use:



instead of:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!