📄 timelistener.java
字号:
package PetsFinder;import javax.swing.Timer;import java.awt.*;import javax.swing.*;import javax.swing.event.*;import java.awt.event.*;public class timeListener implements ActionListener{ static int delay=1000; static Timer t=new Timer(1000,new timeListener()); static JLabel 显示时间=new JLabel(); public void actionPerformed(ActionEvent e) { if(t.isRunning()==true){ Hero.time++; 显示时间 .setText("时间"+Hero.time);// System.out.println(Hero.time);// System.out.println("abc"); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -