wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes why there's no header in my JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "why there Watch "why there New topic
Author

why there's no header in my JTable

david hu
Ranch Hand

Joined: Jul 20, 2001
Posts: 143
I use these following code to initialize the JTable(of course, there are some other codes to setup the TableColumn objects). My problem is that the header of the table is not shown up? Can anyone give me some direction?

I know that in the constractor of JTable, I can provide a parameter corresponding to the columns headers. But since I use default construct, if there any way to setup the header later?

JTable contractorTable = new JTable();
ContractorTableData data = new ContractorTableData();//extends abstractTableModel
contractorTable.setModel(data);
S Perreault
Ranch Hand

Joined: Oct 29, 2003
Posts: 37
Did you add this method to your implementation of AbstractTableModel?



/** Returns the column name for a particular column. */
public String getColumnName(int col)

Perogi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why there's no header in my JTable
 
Similar Threads
JTable(!!!)
JTable
JTable
jtable
JTable