Rili.java:119:找不到符号求大神帮忙更正!!!
编译时出现这个问题。
Rili.java:119:找不到符号
符号:类 Timer
位置:类 Rili
new Timer(lt).start();
1 错误
界面源代码
public Rili()
{
super("万年历"); //框架命名
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//窗口关闭函数
this.getContentPane().setLayout(new BorderLayout(10, 0));
jta.setLineWrap(true);
table.setGridColor(Color.red); //星期之间的网格线是红色的
table.setColumnSelectionAllowed(true);
table.setSelectionBackground(Color.BLACK);//当选定某一天时这一天背景黑色
table.setSelectionForeground(Color.GREEN);//选定的日期字体是绿色的
table.setBackground(new Color(184,207,229));//日期显示表格颜色浅蓝色
table.setFont(new Font("黑体",Font.BOLD,24));//日期数字字体格式
table.setRowHeight(30);//表格的高度
table.addMouseListener(this); //鼠标监听
jtfYear.addActionListener(this);//可输入年份的文本框
//**********为各个按钮添加监听函数*********
bAdd.addActionListener(this);
bDel.addActionListener(this);
bLastYear.addActionListener(this);
bNextYear.addActionListener(this);
bLastMonth.addActionListener(this);
bNextMonth.addActionListener(this);
//将按钮添加到Jpanel上
p1.add(bLastYear);
p1.add(jtfYear);//年份输入文本框
p1.add(bNextYear);
p1.add(bLastMonth);
p1.add(jtfMonth);
p1.add(bNextMonth);
p2.add(bAdd);
p2.add(bDel);
p3.add(jsp, BorderLayout.CENTER);
p3.add(p2, BorderLayout.SOUTH);
p3.add(ld, BorderLayout.NORTH);
p4.add(l);
p4.add(lt);
p5.add(p4, BorderLayout.SOUTH);
p5.add(sp, BorderLayout.CENTER);
p5.add(p1, BorderLayout.NORTH);
this.getContentPane().add(p5, BorderLayout.CENTER);
this.getContentPane().add(p3, BorderLayout.EAST);
String [] strDate = DateFormat.getDateInstance().format(new Date()).split("-");//获得日期
cld.set(Integer.parseInt(strDate[0]), Integer.parseInt(strDate[1])-1, 0);
showCalendar(Integer.parseInt(strDate[0]), Integer.parseInt(strDate[1]), cld);
jtfMonth.setEditable(false);//设置月份的文本框为不可编辑
jtfYear.setText(strDate[0]);
jtfMonth.setText(strDate[1]);
this.showTextArea(strDate[2]);
ld.setFont(new Font("新宋体",Font.BOLD,24));
new Timer(lt).start();
this.setBounds(500,500,600,320);
this.setResizable(false);
this.setVisible(true);
}
代码不完整,不能完整判断问题所在
但从错误信息看,应该是头上少了
import java.util.* ;