freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于java的在線考試系統(tǒng)設(shè)計與實現(xiàn)畢業(yè)論文-資料下載頁

2025-06-25 13:55本頁面
  

【正文】 Id 值 * @return */public int getId(){//1 從 Id 的文本輸入框中獲取用戶輸入的內(nèi)容String info = ()。//2 將這個字符串轉(zhuǎn)換成 int 值,并返回return (info)。}/** * 通過此方法可以獲取到窗口中用戶輸入的密碼 * @return */public String getPassword(){防災(zāi)科技學(xué)院畢業(yè)設(shè)計24/** * 注意:要獲取密碼框中的內(nèi)容不要調(diào)用 getText()方法,官方不推薦使用, * 想獲取密碼框內(nèi)容調(diào)用 getPassword()方法,返回一個 char[] */char[] password = ()。return new String(password)。//char 轉(zhuǎn)換為一個字符串并返回}/** * 此方法用于讓登錄窗口顯示錯誤信息 * @param message */public void showError(String message/*error*/){(message/*error*/)。()。/** * 是 LoginFrame 的屬性 * message 是局部變量,可以將局部變量該為 error,就容易看懂 *///窗口抖動final Timer timer = new Timer()。//獲取當(dāng)前窗口的坐標(biāo),用一個 Point 實例保存,其中有 x 和 yfinal Point start = ()。//給 Timer 添加一個任務(wù),用于周期性改變窗口坐標(biāo),模擬晃動效果(new TimerTask(){int []offset = {1,2,1,0,1,2,1,0}。防災(zāi)科技學(xué)院畢業(yè)設(shè)計25int i = 0。public void run(){Point p = getLocation()。//獲取當(dāng)前窗口坐標(biāo) += offset[i++ % ]。//防止 i 等于 8 時,數(shù)組下標(biāo)越界 += offset[i++ % ]。setLocation(p)。}}, 0, 50)。//每各 1 秒鐘執(zhí)行一下 run 方法//給 Timer 添加一個任務(wù),用于在若干秒后停止 Timer,停止晃動效果(new TimerTask(){public void run(){setLocation(start)。()。}}, 1000)。}} 考試模塊的實現(xiàn)當(dāng)學(xué)生成功登錄后,會自動跳轉(zhuǎn)到考試界面,考試界面由 頁面實現(xiàn),它的代碼實現(xiàn)文件由實體類,以及它的服務(wù)類來實現(xiàn)完成。只有考生成功登錄后方可進(jìn)入本頁面,本頁面會提示用戶的一些基本信息,用戶可自行選擇所要繼續(xù)進(jìn)行的步驟,考生單擊相應(yīng)的圖片按鈕會觸發(fā)相應(yīng)的動作。它的運(yùn)行界面如圖 44 所示:防災(zāi)科技學(xué)院畢業(yè)設(shè)計26圖 44 考試界面部分實現(xiàn)代碼如下:package 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。防災(zāi)科技學(xué)院畢業(yè)設(shè)計27/** * 菜單窗口 */public class MenuFrame extends JFrame{private JLabel info。//用于顯示歡迎信息的 labelprivate ClientContext clientContext。public void setClientContext(ClientContext clientContext){ = clientContext。}public MenuFrame(){init()。}private void init(){(基于 Java 的在線考試系統(tǒng))。(600,400)。(null)。(contentPane())。(DO_NOTHING_ON_CLOSE)。(new WindowAdapter(){@Overridepublic void windowClosing(WindowEvent e) {()。//不能直接寫 this,直接寫this 指的是 WindowEvent}})。}/** * 創(chuàng)建主 Panel* @return防災(zāi)科技學(xué)院畢業(yè)設(shè)計28 */private JPanel contentPane(){JPanel panel = new JPanel(new BorderLayout())。/** * north 一張圖 * center 一個 panel(4 個圖片按鈕) * south 一個字符串 *//** * 顯示圖片的步驟: * 1:創(chuàng)建 ImageIcon * 2:創(chuàng)建一個 Label 用于顯示 ImageIcon */ImageIcon image = new ImageIcon(().getResource())。JLabel imageLabel = new JLabel(image)。(imageLabel,)。(createMenuPane(), )。(new JLabel(095042309 魏增麗版權(quán)所有 盜版必究,),)。return panel。}private JPanel createMenuPane(){JPanel panel = new JPanel(new BorderLayout())。/** * north 歡迎文字 * center 存放四個圖片按鈕 */info = new JLabel(,)。防災(zāi)科技學(xué)院畢業(yè)設(shè)計29(info,)。(createBtnPane(), )。return panel。}/** * 創(chuàng)建包含 4 圖片個按鈕的 panel * @return */private JPanel createBtnPane(){JPanel panel = new JPanel()。/** * 創(chuàng)建圖片按鈕的步驟: * 1:創(chuàng)建 ImageIcon * 2:創(chuàng)建 Button,使用重載的構(gòu)造方法: * JButton(String txt,ImageIcon icon) * 或者后期設(shè)置圖片,調(diào)用 JButton 的方法 setIcon(ImageIcon icon) *///開始按鈕ImageIcon icon = new ImageIcon(().getResource())。JButton start = new JButton(開始,icon)。//設(shè)置文字在中下放:水平中間,垂直下面()。()。//分?jǐn)?shù)防災(zāi)科技學(xué)院畢業(yè)設(shè)計30ImageIcon icon2 = new ImageIcon(().getResource())。JButton result = new JButton(分?jǐn)?shù),icon2)。()。()。//考試規(guī)則ImageIcon icon3 = new ImageIcon(().getResource())。JButton message = new JButton(考試規(guī)則,icon3)。()。()。//離開ImageIcon icon4 = new ImageIcon(().getResource())。JButton exit = new JButton(離開,icon4)。()。()。//開始JButton start = createImageButton(,開始)。//添加一個按鈕的點擊事件(new ActionListener(){//當(dāng)開始考試按鈕被點擊后,通知控制器開始考試public void actionPerformed(ActionEvent e) {()。}防災(zāi)科技學(xué)院畢業(yè)設(shè)計31})。//分?jǐn)?shù)JButton result = createImageButton(,分?jǐn)?shù))。//考試規(guī)則JButton message = createImageButton(,考試規(guī)則)。//離開JButton exit = createImageButton(,離開)。(new ActionListener(){@Overridepublic void actionPerformed(ActionEvent e) {()。}})。(start)。(result)。(message)。(exit)。return panel。}/** * 創(chuàng)建圖片按鈕 */private JButton createImageButton(String imageName,String txt){ImageIcon image = new ImageIcon(().getResource(imageName))。JButton btn = new JButton(txt,image)。//設(shè)置按鈕上的文字在中下方,水平居中,垂直底部()。()。防災(zāi)科技學(xué)院畢業(yè)設(shè)計32return btn。}/** * 此方法用于更新菜單窗口中的用于顯示歡迎信息的 JLabel * @param user 當(dāng)前登錄成功的用戶 */public void updateView(User user){String name = ()。String str = 歡迎+name+參加考試!。//向用于顯示歡迎信息的 label 中設(shè)置歡迎信息(str)。}public static void main(String[] args) {MenuFrame m = new MenuFrame()。(true)。}} 進(jìn)入考試管理在考試界面,考生選擇進(jìn)入考試,可自動跳轉(zhuǎn)到考試界面,那么此時的計時器也便開始計時,顯示在考試系統(tǒng)的試題為從文件中自動隨機(jī)讀取的考試題目,界面由 頁面實現(xiàn),它的代碼實現(xiàn)文件由實體類,以及它的服務(wù)類來實現(xiàn)完成。在規(guī)定的時間之內(nèi)考生如果答題完畢,那么考生可以自己自愿交卷,在考試即將結(jié)束之前,系統(tǒng)會通過提示時間的變換顏色來提示考生時間即將到達(dá),如果在規(guī)定的時間之內(nèi)考生沒有答題完畢,那么為了保障考試的公平性,系統(tǒng)會自動提示考生考試時間已經(jīng)到達(dá),并且系統(tǒng)會自動收回試卷。它的運(yùn)行界面如圖 43 所示:防災(zāi)科技學(xué)院畢業(yè)設(shè)計33圖 441 進(jìn)入考試圖部分實現(xiàn)代碼如下:package 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。import 。防災(zāi)科技學(xué)院畢業(yè)設(shè)計34import 。import 。import 。import 。import 。import 。/** * 考試窗口 */public class ExamFrame extends JFrame{//控制器private ClientContext clientContext。//添加此屬性,用于記錄當(dāng)前考試信息private ExamInfo examInfo。//用于顯示考試信息的 labelprivate JLabel examInfoLabel。//用于顯示考題的 TestAreaprivate JTextArea questionArea。private JLabel questionCount。private JLabel timer。private JButton prev。//上一題按鈕private JButton next。//Option 數(shù)組,存放四個用戶選項的多選框private Option options[] = new Option[4]。public void setClientContext(ClientContext clientContext){防災(zāi)科技學(xué)院畢業(yè)設(shè)計35 = clientContext。}public ExamFrame(){init()。}private void init(){(基于 Java 的在線考試系統(tǒng))。(650,380)。(createContentPane())。(null)。(DO_NOTHING_ON_CLOSE)。/** * 關(guān)閉窗口時,不應(yīng)將程序退出,而是做交卷動作 */(new WindowAdapter(){@Overridepublic void windowClosing(WindowEvent e) {()。}})。}/** * 創(chuàng)建主 Panel */private JPanel createContentPane(){JPanel panel = new JPanel(new BorderLayout())。(new EmptyBorder(8,8,8,8))。防災(zāi)科技學(xué)院畢業(yè)設(shè)計36/** * north 一張圖片 * center 考試題干信息及選項的 panel * south 操作按鈕及考試信息的 panel
點擊復(fù)制文檔內(nèi)容
高考資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1