有关Java定时器的问题

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.*;
/*
*测试swing中Timer的使用,一个显示时间的GUI程序
*/
public class TimerTest extends JFrame implements ActionListener
{
//一个显示时间的JLabel
private JLabel jlTime=new JLabel();
private Timer timer;
public TimerTest()
{
setTitle("Timer测试");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(180,80);
add(jlTime);
//设置Timer定时器并启动
timer=new Timer(500,this);
timer.start();
setVisible(true);
}

public void actionPerformed(ActionEvent e)
{
    DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date date=new Date();
    jlTime.setText(format.format(date));
}

public static void main(String[] args)
{
    new TimerTest();
}

}

timer=new Timer(500,this);这条语句中的this是什么意思,代表什么?

你这是 书上看的例子吧。以后不要这么写。
那些教材为方便,把自定义类继承JFrame又去实现了接口。这样写不好,更难理解。
public class TimerTest extends JFrame implements ActionListener
{

timer=new Timer(500,this);这条语句中的this代表当前对象,也就是TimerTest 这个自定义类的当前对象,因为TimerTest 继承JFrame又去实现了接口,它即是个JFrame,他也是个事件监听类,实现接口ActionListener,重写public void actionPerformed(ActionEvent e)就可以处理某些事件响应。
timer=new Timer(500,this);中的this就是个“任务”,具体就是执行actionPerformed()方法。

执行的是下面的提供的方法,楼上说的对的,actionPerformed()-------,教科书上的例子吧 ,没什么心意;Swing. JFrame

当前正在运行的实例,也就是main方法中调用构造器new TimerTest()生成的实例

this代表TimerTest 相当于构造器