package com;import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;public class Timer
{
public static void main(String args[])
{
int delay = 100;
ActionListener taskPerformer = new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.out.println("^^^^^^^^^^^^^^");
}
};
new javax.swing.Timer(delay,taskPerformer).start();
}}代码编译,没有错误,但不能执行输出语句,错在哪儿啊?
import java.awt.event.ActionListener;
import javax.swing.*;public class Timer
{
public static void main(String args[])
{
int delay = 100;
ActionListener taskPerformer = new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.out.println("^^^^^^^^^^^^^^");
}
};
new javax.swing.Timer(delay,taskPerformer).start();
}}代码编译,没有错误,但不能执行输出语句,错在哪儿啊?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货