Re: JTable display
- From: "John B. Matthews" <nospam@xxxxxxxxxx>
- Date: Tue, 25 Mar 2008 09:39:06 -0400
In article
<102e154f-829f-46e5-a533-fd0c2c6de19f@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Abbas <a.mohamed.abbas.ali@xxxxxxxxx> wrote:
In the below code I'm trying to display two fields (String and Date),[...]
what happens is I'm not able to get the desired display of date in the
JTable. Can any one help me in getting the date displayed like "H:m |
dd-MM-yyyy"?
Thanks,
Abbas
public JTable mainTable = new JTable();[...]
public DefaultTableModel defaultTableModel = new DefaultTableModel(){
public Class getColumnClass(int c){
return getValueAt(0,c).getClass();
}
};
Your implementation of getColumnClass() is incorrect. The default
implementation provided by AbstractTableModel does what you want:
public DefaultTableModel defaultTableModel = new DefaultTableModel();
John
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
.
- Follow-Ups:
- Re: JTable display
- From: Abbas
- Re: JTable display
- References:
- JTable display
- From: Abbas
- JTable display
- Prev by Date: JavaME api download
- Next by Date: Re: JTable display
- Previous by thread: Re: JTable display
- Next by thread: Re: JTable display
- Index(es):