我做的程序并行下载多个文件时 或者是并行上传多个文件时 进度条等状态信息都没问题
但是下载和上传时就有问题了
例如:
先上传几个文件,上传的状态信息都正常,再下载一个文件,原来的那几条上传状态信息
清空了, 我觉得问题就是这几个方法
public void addDownloadRow(FileDivUnit fileDownload){
fileDownload.addObserver(this);
downloadList.add(fileDownload);
fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
}
public void addUploadRow(FileDivUnit fileUpload){
fileUpload.addObserver(this);
downloadList.add(fileUpload);
fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
}
public Object getValueAt(int row, int col) {
FileDivUnit upDownValue = null;
upDownValue = (FileDivUnit)downloadList.get(row);
switch (col){
case 0 :return sign ? upDownValue.getDownFileName() : upDownValue.getUpFileName(); //原来是这个
case 1 :return sign ? upDownValue.getDownFileSize() : upDownValue.getUpFileSize();
case 2 :return sign ? upDownValue.getDownStatus() : upDownValue.getUpStatus();
case 3 :return sign ? upDownValue.getDownPath() : upDownValue.getUpPath() ;
case 4 :return sign ? new Float(upDownValue.getDownProgress()):
new Float(upDownValue.getUpProgress());
case 5 :return new Date();
case 6 :return new Date();
}
return null;
}请教高手!!!!!!!!!!!!!!!!
但是下载和上传时就有问题了
例如:
先上传几个文件,上传的状态信息都正常,再下载一个文件,原来的那几条上传状态信息
清空了, 我觉得问题就是这几个方法
public void addDownloadRow(FileDivUnit fileDownload){
fileDownload.addObserver(this);
downloadList.add(fileDownload);
fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
}
public void addUploadRow(FileDivUnit fileUpload){
fileUpload.addObserver(this);
downloadList.add(fileUpload);
fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
}
public Object getValueAt(int row, int col) {
FileDivUnit upDownValue = null;
upDownValue = (FileDivUnit)downloadList.get(row);
switch (col){
case 0 :return sign ? upDownValue.getDownFileName() : upDownValue.getUpFileName(); //原来是这个
case 1 :return sign ? upDownValue.getDownFileSize() : upDownValue.getUpFileSize();
case 2 :return sign ? upDownValue.getDownStatus() : upDownValue.getUpStatus();
case 3 :return sign ? upDownValue.getDownPath() : upDownValue.getUpPath() ;
case 4 :return sign ? new Float(upDownValue.getDownProgress()):
new Float(upDownValue.getUpProgress());
case 5 :return new Date();
case 6 :return new Date();
}
return null;
}请教高手!!!!!!!!!!!!!!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货