你要的是这个吧:
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.text.DateFormat;
import java.util.Date;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class GUIThread extends JFrame implements java.awt.event.ActionListener{
private JButton jb1 = new JButton("计时");
private JButton jb2 = new JButton("当前时间");
private JLabel jl1 = new JLabel("");
private JLabel jl2 = new JLabel("");
public GUIThread(){
super("GUIThread");
this.setSize(300,200);
this.setLocation(400, 400);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new GridLayout(2,2));
this.jb1.addActionListener(this);
this.jb2.addActionListener(this);
this