Bom dia, eu tenho esse código abaixo e estou tentando colocar um JProgressBar . Eu consigo fazer com que ele apareça, mais só seta o nº99 no final da barra, a barra não aparece e vai do 0 ao 99.
[code] private void importarArquivo(){
BackupRn lBackupRn = null;
File lFile = null;
JProgressBar lBarra = null;
JPanel lPanel = null;
try {
lBackupRn = new BackupRn();
lBarra = new JProgressBar(0, 100);
lPanel = new JPanelISSe();
//barra de progresso
lBarra.setValue(0);
lBarra.setStringPainted(true);
lPanel.setLayout(new FlowLayout());
lPanel.add(BorderLayout.CENTER,lBarra);
lFile = getTela().getSelecionadorArquivos().getSelectedFile();
this.getTela().getSelecionadorArquivos().setVisible(false);
getTela().add(lPanel,BorderLayout.CENTER);
this.getTela().setSize(100, 50);
this.getTela().repaint();
centralizar(lBarra);
lBarra.setVisible(true);
lBarra.setValue(55);
//SwingUtilities.invokeLater(new BarraProgresso(lBackupRn, lFile));
esperar();
lBackupRn.salvarBanco(
lFile.getName().indexOf(".zip") > 0 ? lFile.getName() : lFile.getName() + ".zip",
lFile.getParent() + "\\");
esperar();
lBarra.setValue(75);
esperar();
lBarra.setValue(99);
//fecharTela(getTela());
mostrarMensagemDicionario(MensagensIf.MSG_BACKUP_GERADO);
} catch (Exception ex) {
fecharTela(getTela());
tratarErro(ex);
}
}[/code]