aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable  column header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable  column header" Watch "JTable  column header" New topic
Author

JTable column header

Nick Kocher
Greenhorn

Joined: Nov 24, 2004
Posts: 14
hi,

this should be an easy question but I'm stuck

is there any method to change the Column names of a JTable after creating it?(Sure there is)

to get the name of the Column,we can use the method of AbstractTableModel getColumnName(int col). is that right?

any help is appreciated
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
With the table, getColumnModel and with this get a reference to the TableColumn you want to change. Then call column.setHeaderValue.

If you want to change all of the column headers you can use one of the DefaultTableModel methods setColumnIdentifiers.
[ December 16, 2004: Message edited by: Craig Wood ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable column header
 
Similar Threads
JTable
JTable
excel but in a jTable
JTable
JTable