📄 pizzatimer.java
字号:
import java.util.*;
import java.sql.*;
import java.util.Date;
public class PizzaTimer
{
private final Timer timer = new Timer();
private final int seconds;
private BakeFinishDialog tempDialog;
private ArrayList aBakeList;
private java.awt.List bBakeList;
private int nowIndex;
public PizzaTimer(int aSeconds,ArrayList aList,java.awt.List bList,int i)
{
this.seconds = aSeconds;
this.aBakeList=aList;
this.bBakeList=bList;
this.nowIndex=i;
}
public void start()
{
timer.schedule(new TimerTask() {
public void run() {
ShowDialog();
Date nowTime=new Date();
String time=nowTime.getHours()+":"+nowTime.getMinutes()+":"+nowTime.getSeconds();
bBakeList.add((String)(bBakeList.getItem(nowIndex-1))+" endTime "+time,(nowIndex-1));
bBakeList.remove(nowIndex);
timer.cancel();
}
private void ShowDialog()
{
tempDialog=new BakeFinishDialog();
tempDialog.setDialog(aBakeList,nowIndex);
tempDialog.show();
}
}, seconds * 1000);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -