public class ChouJiangFrame extends JFrame implements Runnable {
// 手机号码
private String[] tel;
// 用来装载不同的手机号载体
private JLabel text = new JLabel();
// 启动和停止按钮
private JButton startAndStopButton = new JButton("启 动");
// private JButton stopButton = new JButton("停 止");
// label面板
private JPanel centerPanel = new JPanel();
// 按钮面板
private JPanel buttonPanel = new JPanel();
// 手机号滚动线程
private Thread th;
// 手机数组下标
private int suffix;
// 参加抽奖的手机号个数
private int sum;
// 未启动状态
public static final int NEW_THREAD = 0;
// 暂停状态
public static final int PAUSE_THREAD = 1;
// 启动状态
public static final int START_THREAD = 2;
// 线程的状态
private int state = NEW_THREAD;
public ChouJiangFrame(String[] tel) {
this.init();
this.tel = tel;
sum = tel.length;
startAndStopButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
execute();
}
});
}