pizzatimer.java
来自「java编的销售系统」· Java 代码 · 共 44 行
JAVA
44 行
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 + =
减小字号Ctrl + -
显示快捷键?