Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding JTableHeader  RSS feed

 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any method to clear column names of JTableHeader ?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
table.getTableHeader().getColumnModel().getColumn([columnNumber]).setHeaderValue("");
repaint();
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael Dunn Thank you for your reply.

I can implement the JTable using DefaultTableModel,there are two panels,
In first panel there are 5 textfields and a "ADD TO TABLE" button and In second panel there are one JTable and a "BACK" button.If i enter data in 5 textfields and press "ADD TO TABLE" button, the data will be stored in both JTable and also in columns of JTableHeader simultaneously in second panel, if i press "BACK" button the entire JTable data and columns of JTableHeader should be cleared and cursor will go to first panel and i again enter data in 5 textfields and press "ADD TO TABLE" button, i want to show the new data in JTable(previous data can be cleared)and JTableHeader.This process continues all times. i can implement but it didn't work properly.please give me any suggestions regarding this issue.

Thank you in advance

raja.tadi@tcs.com
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there's no point duplicating your other post here.
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael Dunn

Actually my doubt is when some action generetes, the column names of JTableHeader should be cleared and i want to enter fresh data in JTableHeader colum names.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!