J
J
Javanutiy2017-05-24 15:51:24
Java
Javanutiy, 2017-05-24 15:51:24

How to hide form jFrame when timer reaches time?

Hello, please help with closing the form on a timer. From one form, the timer starts, on the second form it is shown in jlabel, after a minute the form with jlabel should close, and another form should open.
.

public  ActionListener actionListener3 = new ActionListener() {
          public void actionPerformed(ActionEvent actionEvent) {
              setVisible(false);
              for(int h=0;h<1;h++){
               System.out.println(jLabel.getText());}
           if(tgl.jLabel20.getText().equals("01:00")){
               dispose();
                timer33.stop(); - таймер с формы запуска таймера
                timer34.stop(); -  таймер без вывода на jlabel
OpTer(); - метод открытия другой формы ( делает другую форму setVisible(true))   
           }}};
public  javax.swing.Timer timer34 = new javax.swing.Timer(1000, actionListener3);

Ignore the fact that there are two timers. Just for each filling of the form there will be some kind of closing time.
As soon as he didn’t try to do it and added the form through the form_object_through_new.dispose () / then he tried through setVisible (false). It opens another form, but cannot close the desired form

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question