91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

Java單機考試系統(tǒng) 基于swing 使用eclipse編譯 便于初學者學習

資源截圖

代碼片段和文件信息

package?elts;
import?java.awt.Color;
import?java.awt.Dimension;
import?java.awt.Toolkit;
import?java.awt.Window;
import?java.io.BufferedReader;
import?java.io.BufferedWriter;
import?java.io.IOException;
import?java.io.InputStreamReader;
import?java.io.OutputStream;
import?java.io.OutputStreamWriter;
import?java.util.List;
import?java.util.Timer;
import?java.util.TimerTask;

import?javax.swing.Jframe;
import?javax.swing.JLabel;
import?javax.swing.JOptionPane;

import?elts.IdOrPwdException;

/**
?*?界面控制器?里面定義了很多界面控制流程
?*?如:?登陸流程?
?*
?*/
public?class?ClientContext?{
private?Loginframe?loginframe;
private?Menuframe?menuframe;
private?ExamService?examService;
private?Examframe?examframe;
private?QuestionInfo?currentQuestionInfo;
private?ExamInfo?examInfo;
private?WelcomeWindow?welcomeWindow;

public?void?setLoginframe(Loginframe?loginframe){
this.loginframe=loginframe;
}
public?void?setMenuframe(Menuframe?menuframe){
this.menuframe=menuframe;
}
public?void?setExamService(ExamService?examService){
this.examService=examService;
}
public?void?setExamframe(Examframe?examframe){
this.examframe=examframe;
}
public?void?setWelcomeWindow(WelcomeWindow?welcomeWindow)?{
????this.welcomeWindow?=?welcomeWindow;
??}
/**
?*??登陸流程?
?*?1)?從登陸界面獲取用戶ID和pwd
?*?2)?利用業(yè)務(wù)層對象根據(jù)ID和PWD判斷是否能夠登錄
?*?3)?如果可以登陸就更新菜單界面
?*?4)?關(guān)閉登錄界面
?*?5)?顯示菜單界面
?*?6)?如果登陸失敗留在登錄界面顯示失敗信息
?*/
public?void?login()?{
try?{
int?id=loginframe.getUserId();
String?pwd=loginframe.getPwd();
User?user=examService.login(id?pwd);
menuframe.updateView(user);
loginframe.setVisible(false);
menuframe.setVisible(true);
}?catch?(IdOrPwdException?e)?{
e.printStackTrace();
loginframe.showMessage(e.getMessage());

}catch(NumberFormatException?e){
e.printStackTrace();
loginframe.showMessage(“編號必須為數(shù)字!“);
}

}
public?void?showUI(){
// loginframe.setVisible(true);
center(welcomeWindow);
welcomeWindow.setVisible(true);
final?Timer?timer=new?Timer();
timer.schedule(new?TimerTask()?{

@Override
public?void?run()?{
//?TODO?Auto-generated?method?stub
welcomeWindow.setVisible(false);
center(loginframe);
loginframe.setVisible(true);

timer.cancel();
}
}?2000);
}
public?void?exit(Jframe?from)?{
????int?val?=?JOptionPane
??????.showConfirmDialog(from?“確定退出嗎??“);
????if(val==JOptionPane.YES_OPTION){
??????System.exit(0);
????}
??}
public?void?start()?{
//?TODO?Auto-generated?method?stub
try?{//考試信息
ExamInfo?examInfo=examService.startExam();
//第一道考題
QuestionInfo?questionInfo=examService.getQuestionInfo(0);
examframe.updateView(examInfoquestionInfo);
menuframe.setVisible(false);
examframe.setVisible(true);
this.currentQuestionInfo=questionInfo;
this.examInfo=examInfo;
startTime();

}?catch?(Exception?e)?{
e.printStackTrace();
JOptionPane.showMessageDialog(menuframe?e.getMessage());
//?TODO:?handle?exception
}
}
// private?OutputStream?file;
publi

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????295??2012-12-28?10:25??.classpath
?????文件?????????365??2012-12-28?10:25??.project
?????目錄???????????0??2013-03-03?18:01??.settings\
?????文件??????????78??2013-01-04?19:40??.settings\org.eclipse.core.resources.prefs
?????文件?????????587??2012-12-28?10:25??.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2013-03-03?18:01??bin\
?????目錄???????????0??2013-03-03?18:01??bin\elts\
?????文件?????????948??2013-01-08?09:12??bin\elts\ClientContext$1.class
?????文件?????????782??2013-01-08?09:12??bin\elts\ClientContext$2.class
?????文件?????????561??2013-01-08?09:12??bin\elts\ClientContext$3.class
?????文件????????7233??2013-01-08?09:12??bin\elts\ClientContext.class
?????文件????????1251??2013-01-08?08:39??bin\elts\Config.class
?????文件???????????0??2012-12-28?10:44??bin\elts\demo.txt
?????文件????????5666??2013-01-08?08:39??bin\elts\EntityContext.class
?????文件????????3573??2012-12-28?19:16??bin\elts\exam.png
?????文件?????????776??2013-01-08?08:39??bin\elts\Examframe$1.class
?????文件?????????776??2013-01-08?08:39??bin\elts\Examframe$2.class
?????文件?????????776??2013-01-08?08:39??bin\elts\Examframe$3.class
?????文件?????????749??2013-01-08?08:39??bin\elts\Examframe$4.class
?????文件?????????582??2013-01-08?08:39??bin\elts\Examframe$Option.class
?????文件????????7012??2013-01-08?08:39??bin\elts\Examframe.class
?????文件?????????562??2013-01-08?08:39??bin\elts\ExamframeTest.class
?????文件????????1964??2013-01-08?08:39??bin\elts\ExamInfo.class
?????文件?????????457??2013-01-08?08:39??bin\elts\ExamService.class
?????文件????????3793??2013-01-08?08:39??bin\elts\ExamServiceImpl.class
?????文件?????????547??2013-01-08?08:39??bin\elts\ExamTest.class
?????文件???????20210??2012-12-28?19:16??bin\elts\exam_title.png
?????文件????????3846??2012-12-28?19:16??bin\elts\exit.png
?????文件?????????718??2013-01-08?08:39??bin\elts\IdOrPwdException.class
?????文件????????1627??2013-01-08?08:39??bin\elts\JframeDemo.class
?????文件????????1412??2013-01-08?08:39??bin\elts\LayoutDemo.class
............此處省略84個文件信息

評論

共有 條評論