JAVA抽奖系统源代码Word格式.docx

上传人:b****2 文档编号:3413961 上传时间:2023-05-01 格式:DOCX 页数:21 大小:18.31KB
下载 相关 举报
JAVA抽奖系统源代码Word格式.docx_第1页
第1页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第2页
第2页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第3页
第3页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第4页
第4页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第5页
第5页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第6页
第6页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第7页
第7页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第8页
第8页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第9页
第9页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第10页
第10页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第11页
第11页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第12页
第12页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第13页
第13页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第14页
第14页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第15页
第15页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第16页
第16页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第17页
第17页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第18页
第18页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第19页
第19页 / 共21页
JAVA抽奖系统源代码Word格式.docx_第20页
第20页 / 共21页
亲,该文档总共21页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

JAVA抽奖系统源代码Word格式.docx

《JAVA抽奖系统源代码Word格式.docx》由会员分享,可在线阅读,更多相关《JAVA抽奖系统源代码Word格式.docx(21页珍藏版)》请在冰点文库上搜索。

JAVA抽奖系统源代码Word格式.docx

//SubstanceLookAndFeel.setCurrentBorderPainter(new

//StandardBorderPainter());

//SubstanceLookAndFeel.setCurrentGradientPainter(new

//StandardGradientPainter());

//水晶蓝

//SubstanceLookAndFeel.setCurrentTitlePainter(new

//FlatTitlePainter());

}catch(Exceptione)

}

showPerson();

}catch(IOExceptione)

//TODOAuto-generatedcatchblock

e.printStackTrace();

}

publicvoidshowPerson()throwsIOException

"

/com/insigma/config/name.txt"

).getPath());

FileInputStreamfileInputStream=newFileInputStream(filename);

InputStreamReaderinputStreamReader=newInputStreamReader(

fileInputStream,"

gbk"

);

BufferedReaderbufferedReader=newBufferedReader(inputStreamReader);

Stringname="

"

;

Stringbufname="

intkey=1;

while((name=bufferedReader.readLine())!

=null)

if(bufname.equals("

))

bufname=name;

else

bufname=bufname+"

\n"

+name;

key++;

/**Thismethodiscalledfromwithintheconstructorto

*initializetheform.

*WARNING:

DoNOTmodifythiscode.Thecontentofthismethodis

*alwaysregeneratedbytheFormEditor.

//GEN-BEGIN:

initComponents

//<

editor-folddefaultstate="

collapsed"

desc="

GeneratedCode"

>

privatevoidinitComponents()

setTitle("

\u516c\u53f8\u5e74\u7ec8\u62bd\u5956\u7cfb\u7edf"

jLabel1.setText("

\u4e00\u7b49\u5956\u83b7\u5f97\u8005\uff1a"

jLabel2.setText("

\u4e8c\u7b49\u5956\u83b7\u5f97\u8005\uff1a"

jLabel3.setText("

\u4e09\u7b49\u5956\u83b7\u5f97\u8005\uff1a"

jTextArea1.setColumns(20);

jTextArea1.setRows(5);

jScrollPane1.setViewportView(jTextArea1);

jTextArea2.setColumns(20);

jTextArea2.setRows(5);

jScrollPane2.setViewportView(jTextArea2);

jTextArea3.setColumns(20);

jTextArea3.setRows(5);

jScrollPane3.setViewportView(jTextArea3);

jLabel5.setText("

\u62bd\u5956\u8005\u540d\u5355\uff1a"

jTextArea4.setColumns(20);

jTextArea4.setRows(5);

jScrollPane4.setViewportView(jTextArea4);

jButton1.setText("

\u5f00\u59cb"

{

jButton1ActionPerformed(evt);

}

});

jButton2.setText("

\u6682\u505c"

jButton2.setEnabled(false);

jButton2ActionPerformed(evt);

jButton3.setText("

\u91cd\u7f6e"

jButton3.setEnabled(false);

jButton3ActionPerformed(evt);

jLabel6.setText("

\u516c\u53f8\u5e74\u7ec8\u62bd\u5956"

getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(layout

.addGroup(

layout.createSequentialGroup()

.addGroup(

layout.createParallelGroup(

.addGroup(

layout.createSequentialGroup()

.addGap(98,98,

98)

.addComponent(

jButton1)

.addGap(47,47,

47)

jButton3)

.addGap(44,44,

44)

jButton2)

.addGap(104,

104,

104))

.addContainerGap()

.addGroup(

layout.createParallelGroup(

.addGroup(

layout.createSequentialGroup()

.addGroup(

layout.createParallelGroup(

.addComponent(

jScrollPane1,

142,

jLabel1))

.addPreferredGap(

14,

Short.MAX_VALUE)

jLabel2)

jScrollPane2,

137,

.addGap(33,

33,

33)

jScrollPane3,

126,

jLabel3)))

.addGap(108,

108,

108)

.addComponent(

jLabel6))

.addComponent(

jLabel5)

jScrollPane4,

134,

80,

jLabel4,

116,

.addGap(122,

122,

122)))

.addPreferredGap(

.addGap(13,13,13)));

layout.setVerticalGroup(layout

.addComponent(jLabel6)

.addGap(26,26,26)

jLabel1)

jScrollPane1,

jLabel3)

jLabel2))

jScrollPane3,

jScrollPane2,

.addGap(28,28,28)

.addComponent(jLabel5)

.addPreferredGap(

.addComponent(

jLabel4,

148,Short.MAX_VALUE)

jScrollPane4,

148,Short.MAX_VALUE))

.addComponent(jButton1)

layout.createParallelGroup(

jButton2)))

.addContainerGap()));

pack();

}//<

/editor-fold>

//GEN-END:

/**

*重置事件

*@paramevt

CommUtil.boo=false;

//重置计数器

CommUtil.firstsum=0;

CommUtil.secondsum=0;

CommUtil.thirdsum=0;

//清空抽奖框

//重置人员

*暂停事件

*开始事件

CommUtil.boo=true;

CardThreadcardthread=newCardThread(this);

cardthread.start();

ImageThreadimageThread=newImageThread(this);

imageThread.start();

newThread(cardthread).start();

*@paramargsthecommandlinearguments

publicstaticvoidmain(Stringargs[])

publicvoidrun()

{

{

System.exit(0);

}

});

dialog.setVisible(true);

variables

//Variablesdeclaration-donotmodify

//Endofvariablesdeclaration//GEN-END:

}

抽奖功能:

publicclassCardThreadextendsThread

privateMainFramemainframe;

publicCardThread(MainFramemainframe)

this.mainframe=mainframe;

publicvoidrun()

synchronized(mainframe)

firstCard();

secondCard();

thirdCard();

if(CommUtil.isEnd())

*抽一等奖

publicvoidfirstCard()

while(CommUtil.boo&

&

CommUtil.firstsum<

CommUtil.firstcount)

intkey=(int)(Math.random()*60+1);

if(CommUtil.getPerson(key))

+"

+name);

}else

}

CommUtil.deletePerson(key);

Stringbufname=CommUtil.mapToString();

CommUtil.firstsum++;

try

sleep(1000);

}catch(InterruptedExceptione)

//TODOAuto-generatedcatchblock

e.printStackTrace();

*抽三等奖

publicvoidthirdCard()

CommUtil.thirdsum<

CommUtil.thirdcount)

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 总结汇报 > 学习总结

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2