下载后可任意编辑第一章实验一package ch01;import java
SimpleDateFormat;import java
Date;class Timer extends Thread { private SimpleDateFormat sdf = new SimpleDateFormat("yyyy 年 MM 月 dd 日 HH:mm:ss"); public void run() { while (true) { System
print("\r 现在时间是:"); Date now = new Date(); System
print(sdf
format(now)); try { sleep(1000); } catch (InterruptedException e) { e
printStackTrace(); } } }}public class Clock { public static void main(String[] args) { Timer timer = new Timer(); timer
start(); }}实验二package ch01;import java
MouseAdapter;import java
MouseEvent;import java
Random;import javax
JButton;import javax
JFrame;public class MagicButton extends MouseAdapter { JFrame win; JButton button = new JButton("你点不到我"); Random rand = new Random(); void in