📄 timerface.java
字号:
import java.awt.*;
import javax.swing.*;
/*TimerFace.java*/
public class TimerFace extends JPanel
{ public TimerFace(Color c)
{ setup();
String time=""+m1+m2+":"+s1+s2;
face=new JLabel(time,JLabel.CENTER);
face.setFont(f);
setLayout(new BorderLayout());
add(face,BorderLayout.CENTER);
}
protected TimerFace() {}
public void set(int min,int sec)
{ m=min;s=sec;
setup();
String time=""+m1+m2+":"+s1+s2;
face.setText(time);
}
protected void setup()
{ m1=m/10;m2=m%10;
s1=s/10;s2=s%10;
}
protected JLabel face;
protected int m=0,s=0;
protected int m1,m2,s1,s2;
protected Font f=new Font("Courier",Font.BOLD,36);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -