java多线程抽奖_java抽奖系统2(多线程).doc

java抽奖系统2(多线程).doc

package com.yiyi.io.thread;import java.util.List;import java.util.Stack;import com.yiyi.io.gui.*;import javax.swing.JLabel;import javax.swing.JOptionPane;import javax.swing.JTextArea;public class cjthread extends Threadpublic List tmp;public List getTmp() return tmp;public void setTmp(List tmp) this.tmp = tmp;private int ram;public int getRam() return ram;public void setRam(int ram) this.ram = ram;private JTextArea jl;private ListString content;private boolean blo;public boolean isBlo() return blo;public void setBlo(boolean blo) this.blo = blo;public JTextArea getJl() return jl;public void setJl(JTextArea jl) this.jl = jl;public ListString getContent() return content;public void setContent(ListString content) this.content = content;public void run()while(content.size()!=1&blo=true)String con=;random rm=new random();ListInteger ls=rm.random(content.size(),ram);int size=content.size();int i=(int) (Math.random()*size);for (int j = 0; j ls.size(); j+) con+=content.get( ls.get(j)+n;try jl.setText(con);sleep(20); catch (InterruptedException e) e.printStackTrace();this.setTmp(ls

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值