?? clockani.java
字號:
import java.awt.event.*;
import javax.swing.*;
// Finishing Codefans.net
public class ClockAni extends StillClock
{
public ClockAni()
{
Timer time = new Timer (1000,new TimerListener());
time.start();
}
private class TimerListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
setCurrentTime();
repaint();
}
}
public static void main(String [] args )
{
JFrame frame = new JFrame("clock_wak");
ClockAni clock = new ClockAni();
frame.add(clock);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200,200);
frame.setVisible(true);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -