I have this code:
Tela2 t= new Tela2(); //JFrame
File f= jFileChooser1.getSelectedFile() ;
if(f.getName().endsWith("detailed.txt")){
    this.dispose();// close this Jframe
    t.setVisible(true);//open a new one
    p.addAnalise(f); 
}
the "t" JFrame shows up but the components don't show until the method p.addAnalise() is finished, can someone help me?
 
    