I have 3 different JFrames. One Jframe
is a login page another has progressbar
and the third one is main page. Now what i want is that when we login in I want to show progressbar
above login page and on completing progress to 100% I want to close both frames and open third Jframe
which is main page. please kindly help me get this done.
Thanks
//here is the code part.
rs=pstmt.executeQuery();
if(rs.next()){
progressbar prb=new progressbar(user);
prb.setVisible(true);
}// this open my 2nd JFrame of progress bar
//next in Progressbar page i have this code
`public progressbar(String user) {
initComponents();
setLocationRelativeTo(null);
t = new Timer(35, (ActionEvent e) -> {
count++;
pb.setValue(count);
if(pb.getValue()<100){
pb.setValue(pb.getValue() + 1); // it makes bar progress
}
// after progress is 100%
if(pb.getValue()== 100){
t.stop();
this.dispose();
Mainpage mp=new Mainpage(user);
mp.setVisible(true); // this opens my Mainpage
}
});
t.start();
}
// Now what I want is after progress bar completes, I want to dispose both the login page and progress bar page opening Main page only