Não consigo fechar tela SPLASH apos chamar TELA LOGIN!
Galera, estou com um problema simples.
Estou fazendo um programa simples em Java no Neatbeans, eu quero que quando a tela
Splash termine o carregamento ela feche, ficando somente a próxima (Tela login).
TELA SPLASH
public class Splash extends javax.swing.JFrame {
public Splash() {
initComponents();
this.setLocationRelativeTo(null);
this.setResizable(false);
new Thread(){
public void run(){
for(int i=0; i<101; i++){
try {
sleep(20);
BarraDeProgresso.setValue(i);
if(BarraDeProgresso.getValue() <=40 ){
MenssagemDeCarregamento.setText("CARREGANDO SISTEMA...");
}else if(BarraDeProgresso.getValue() <=70){
MenssagemDeCarregamento.setText("CARREGANDO TABELAS...");
}else{
MenssagemDeCarregamento.setText("CARREGANDO BANCO...");
}
} catch (InterruptedException ex) {
Logger.getLogger(SplashScreen.class.getName()).log(Level.SEVERE, null, ex);
}
}
TelaLogin login = null;
try {
login = new TelaLogin();
} catch (ClassNotFoundException e) {
JOptionPane.showMessageDialog(null, e);
}
try {
login = new TelaLogin();
} catch (ClassNotFoundException e) {
JOptionPane.showMessageDialog(null, e);
}
login.setVisible(true);
}
}.start();
}
TELA LOGIN
Discussão (1)
Carregando comentários...