I have two JFrames A and B. I have a gif running on frame A. After a certain time i want to to close frame A and display frame B. I am using following code but it fires action as soon as program is executed. How can i resolve this issue?
ActionListener taskPerformer = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
new FrameB().setVisible(true);
}
};
Timer timer = new Timer(100 ,taskPerformer);
timer.setRepeats(false);
timer.start();