Professional Documents
Culture Documents
Usando Progress Bar
Usando Progress Bar
listFiles(); File fileDest; jProgressBar.setMinimum(0); jProgressBar.setMaximum(listOfFiles.length); for (int i = 0; i < listOfFiles.length; i++) { fileDest = new File(destino); try{ copiarFile(listOfFiles[i], fileDest); UpdateStatusLabel(MSG_MOVE + " >>> " + listOfFiles[i].getName() + " >>> " + destino); } catch(Exception e){ System.out.print("Error: " +e); } jProgressBar.setValue(i); jProgressBar.setStringPainted(true); Rectangle progressRect = jProgressBar.getBounds(); progressRect.x = 0; progressRect.y = 0; jProgressBar.paintImmediately(progressRect); } jProgressBar.setValue(listOfFiles.length); }