java swing multithreading

For example, a reptile

It displays the current refresh all time, once per second to determine the software is not stuck at the interface

When crawling program is running, the interface may be stuck

This program was put on another thread crawling inside

At the same time, you can put in another thread inside rtc

Specific code, liru

final TimerRtc timerRtc = new TimerRtc(1000, new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            new Thread() {
                @Override
                public void run() {
                   //do something
                }
            }.start();

        }
    });

 

Guess you like

Origin www.cnblogs.com/jnhs/p/11257727.html