0
我有一個jtable,包含字符串和日期數據類型的列。 但現在每個信息都以字符串數據形式呈現 我希望在jtable的 日期列中顯示日期數據類型。在jtable中呈現字符串和日期數據類型
我也存在以下代碼數據模型
public class MyTableModel extends AbstractTableModel {
private List<List<Object>> dataList = new ArrayList<>();
private String[] header = { "ID","SUBJECT","LETTTER FROM","LETTER DATE","DATE RECEIED",
"REMARKS","DATE DISPATCHED","DESTINATION OFFICE"};
public List<List<Object>> getDataList() {
return dataList;
}
public void setDataList(List<List<Object>> dataList) {
this.dataList = dataList;
fireTableDataChanged();
fireTableStructureChanged();
}
public void setHeader(String[] header) {
this.header = header;
}
public String[] getHeader() {
return header;
}
@Override
public int getRowCount() {
return dataList.size();
}
@Override
public int getColumnCount() {
return header.length;
}
@Override
public String getColumnName(int col) {
return header[col];
}
@Override
public Object getValueAt(int row, int col) {
return dataList.get(row).get(col);
}
}
任何建議COS是新來的JTable
您可以嘗試使用'JCalendar' – tmwanik 2013-03-21 17:34:11