⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timerdemo.java

📁 That is some example about GUI. It is very good for user to use on BlueJ.
💻 JAVA
字号:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class TimerDemo extends JFrame implements ActionListener {

    Timer timer;

    public static void main(String[] args) {
        TimerDemo frame = new TimerDemo();
        frame.setSize(400,300);
        frame.createGUI();
        frame.show();
    }

    private void createGUI() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        Container window = getContentPane();
        window.setLayout(new FlowLayout());

        timer = new Timer(10000, this);
        timer.start();
    }

    public void actionPerformed(ActionEvent event) {
        JOptionPane.showMessageDialog(null, "tick");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -