main.java

来自「用Java实现时钟」· Java 代码 · 共 39 行

JAVA
39
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package clock;/** * * @author Administrator */import java.awt.*;import javax.swing.*;public class Main extends JFrame {    Container con;    PaintClock cclock;    NowTime now;  public  Main(String s) {        super(s);        this.setBounds(200, 200, 230, 230);        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        cclock = new PaintClock();        now = new NowTime();        con = this.getContentPane();        con.setLayout(new BorderLayout());        con.setBackground(Color.WHITE);        con.add(cclock, BorderLayout.CENTER);        con.add(now, BorderLayout.NORTH);        this.setLocationRelativeTo(null);        this.setVisible(true);    }    public static void main(String[] args) {        Main MyClock = new Main("时钟");    }}

⌨️ 快捷键说明

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