資源簡介
代碼片段和文件信息
package?com.mingrisoft;
import?java.io.FileInputStream;
import?java.io.*;
import?javax.swing.Jframe;
import?javax.swing.ProgressMonitorInputStream;
public?class?ProgressMonitorTest?{
????
????public?void?useProgressMonitor(Jframe?frame?String?copyPath?String?newPath)?{
????????try?{
????????????File?file?=?new?File(copyPath);?//?根據要復制的文件創建File對象
????????????File?newFile?=?new?File(newPath);?//?根據復制后文件的保存地址創建File對象
????????????FileOutputStream?fop?=?new?FileOutputStream(newFile);?//?創建FileOutputStream對象
????????????InputStream?in?=?new?FileInputStream(file);
????????????//?讀取文件,如果總耗時超過2秒,將會自動彈出一個進度監視窗口。
????????????ProgressMonitorInputStream?pm?=?new?ProgressMonitorInputStream(
????????????????????frame?“文件復制中,請稍后...“?in);
????????????int?c?=?0;
????????????byte[]?byt
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????301??2011-05-23?19:43??.classpath
?????文件?????????379??2011-05-23?19:43??.project
?????目錄???????????0??2012-02-22?14:42??.settings\
?????文件?????????629??2011-05-23?19:43??.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2012-02-22?14:42??src\
?????目錄???????????0??2012-02-22?14:42??src\com\
?????目錄???????????0??2012-02-22?14:42??src\com\mingrisoft\
?????文件????????1215??2011-06-02?13:02??src\com\mingrisoft\ProgressMonitorTest.java
?????文件????????5230??2011-05-23?19:43??src\com\mingrisoft\UserMonitorfr
- 上一篇:java從xm
l文件中讀取數據 - 下一篇:java向屬性文件中添加信息
評論
共有 條評論