Bonjour,
Je veux rajouter une ProgressBar à mon code mais ça n'a pas l'air de marcher..
Voici mon code :
Code :
- public void convertirPdf(File source, File destination) {
- String cmd = konvertorSoft.getAbsolutePath();
- String txt = creerTxt(source.getName());
- cmd += " \"Q|" + source.getAbsolutePath();
- cmd += "|" + destination.getAbsolutePath() + "\\" + txt;
- cmd += "|" + configpath.getAbsolutePath() + "\\monIni.ini\"";
- ProgressBarConversion = new JProgressBar(0, 10);
- ProgressBarConversion.setValue(1);
- ProgressBarConversion.repaint();
- lignecommande(cmd);
-
- ProgressBarConversion.setValue(2);
- ProgressBarConversion.repaint();
- try {
- setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- Thread.sleep(2000);
- } catch (InterruptedException ex) {
- } finally {setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));}
- ProgressBarConversion.setValue(5);
- ProgressBarConversion.repaint();
- chargerListeDesSources();
-
- ProgressBarConversion.setValue(10);
- ProgressBarConversion.repaint();
- }
|
Mais rien ne se passe !