J#-文件复制
ylbtech_java
JProgressBar pb = new JProgressBar();//进度条 //JProgressBar File f1 = new File(txt1.getText()); File f2 = new File(txt2.getText()); byte b[] = new byte[1024]; FileInputStream in = new FileInputStream(f1); FileOutputStream out = new FileOutputStream(f2); while(in.read(b) != -1) { out.write(b); } pb.setMaximum(100);//进度最大值 pb.setValue(100);//设置当前进度