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

正文內(nèi)容

java面向?qū)ο蟪绦蛟O(shè)計(jì)教案-資料下載頁

2024-11-03 22:23本頁面
  

【正文】 } addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){ (0)。} })。setBounds(10,10,300,300)。setVisible(true)。validate()。} public void keyPressed(KeyEvent e){int moveDistance=1。Component =(Component)()。int x=(int)().x。int y=(int)().y。Component ponent[]=()。if(()==){ y=ymoveDistance。(x,y)。Rectangle Rect=()。for(int k=0。ky=y+moveDistance。(x,y)。Rectangle Rect=()。for(int k=0。k=300)y=300。} else if(()==){ x=xmoveDistance。(x,y)。Rectangle Rect=()。for(int k=0。kelse if(()==){ x=x+moveDistance。(x,y)。Rectangle Rect=()。for(int k=0。k=300)x=300。} } public void keyTyped(KeyEvent e){} public void keyReleased(KeyEvent e){} } 習(xí)題11 1.A 2. import .*。import .*。import .*。class Dwindow extends Frame implements ActionListener {TextField inputNumber。TextArea save。Dwindow(String s){ super(s)。inputNumber=new TextField(22)。(this)。save=new TextArea(12,16)。setLayout(new FlowLayout())。add(inputNumber)。add(save)。setBounds(60,60,300,300)。setVisible(true)。validate()。addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){ (0)。} })。} public void actionPerformed(ActionEvent event){ String s=()。double n=0。try{ n=(s)。if(n1000){ int select=(this,”已經(jīng)超過1000確認(rèn)正確嗎?“,”確認(rèn)對(duì)話框“, )。if(select==){ (”n“+s)。}else{(null)。}} else {(”n“+s)。} } catch(NumberFormatException e){ (this,”您輸入了非法字符“,”警告對(duì)話框“, )。(null)。} } } public class E {public static void main(String args[]){ new Dwindow(”帶對(duì)話框的窗口“)。} } 3.參照以下例子完成 public class Xiti3 { public static void main(String args[]){ WindowColor win=new WindowColor()。(”帶顏色對(duì)話框的窗口“)。} } import .*。import .*。import .*。public class WindowColor extends JFrame implements ActionListener { JButton button。WindowColor(){ button=new JButton(”打開顏色對(duì)話框“)。(this)。setLayout(new FlowLayout())。add(button)。setBounds(60,60,300,300)。setVisible(true)。setDefaultCloseOperation()。} public void actionPerformed(ActionEvent e){ Color newColor=(this,”調(diào)色板“,())。if(newColor!=null){ (newColor)。}} }習(xí)題12 1.使用FileInputStream流。2.FileInputStream按字節(jié)讀取文件,F(xiàn)ileReader按字符讀取文件。3.不能。4.使用對(duì)象流寫入或讀入對(duì)象時(shí),要保證對(duì)象是序列化的。5.使用對(duì)象流很容易得獲取一個(gè)序列化對(duì)象的克隆,只需將該對(duì)象寫入到對(duì)象輸出流,那么用對(duì)象輸入流讀回的對(duì)象一定是原對(duì)象的一個(gè)克隆。6.import .*。public class Xiti6 { public static void main(String args[]){File f=new File(”“)。try{RandomAccessFile random=new RandomAccessFile(f,”rw“)。(0)。long m=()。while(m=0){m=m1。(m)。int c=()。if(c=0){ ((char)c)。} else { m=m1。(m)。byte cc[]=new byte[2]。(cc)。(new String(cc))。} } } catch(Exception exp){} } }7.import .*。public class Xiti7 { public static void main(String args[ ]){ File file=new File(”“)。File tempFile=new File(”“)。try{ FileReader inOne=new FileReader(file)。BufferedReader inTwo= new BufferedReader(inOne)。FileWriter tofile=new FileWriter(tempFile)。BufferedWriter out= new BufferedWriter(tofile)。String s=null。int i=0。s=()。while(s!=null){i++。(i+” “+s)。()。s=()。} ()。()。()。()。()。} catch(IOException e){ (e)。}} } 8.屬于操作題目,解答略。9.import .*。import .*。import .*。import .*。import .*。public class Xiti9 {public static void main(String args[]){ EWindow w=new EWindow()。()。} } class EWindow extends Frame implements ActionListener,ItemListener { String str[]=new String[7],s。FileReader file。BufferedReader in。Button start,next。Checkbox checkbox[]。TextField 題目,分?jǐn)?shù)。int score=0。CheckboxGroup age=new CheckboxGroup()。EWindow(){ super(”英語單詞學(xué)習(xí)“)。分?jǐn)?shù)=new TextField(10)。題目=new TextField(70)。start=new Button(”重新練習(xí)“)。(this)。next=new Button(”下一題目“)。(this)。checkbox=new Checkbox[4]。for(int i=0。itry { file=new FileReader(”“)。in=new BufferedReader(file)。} catch(IOException e){}setBounds(20,100,660,300)。setVisible(true)。Box box=()。Panel p1=new Panel(),p2=new Panel(), p3=new Panel(),p4=new Panel(),p5=new Panel()。(new Label(”題目:“))。(題目)。(new Label(”選擇答案:“))。for(int i=0。i(new Label(”您的得分:“))。(分?jǐn)?shù))。(start)。(next)。(p1)。(p2)。(p3)。(p4)。addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){ (0)。} })。add(box,)。reading()。}public void reading(){int i=0。try { s=()。if(!((”endend“))){ StringTokenizer tokenizer=new StringTokenizer(s,”“)。while(()){ str[i]=()。i++。} (str[0])。for(int j=1。jreading()。} if(()==next){ reading()。for(int j=0。j} } } public void itemStateChanged(ItemEvent e){ for(int j=0。j} } }習(xí)題13 1.一個(gè)使用鏈?zhǔn)浇Y(jié)構(gòu),一個(gè)使用順序結(jié)構(gòu)。2.8。3.ABCD。4.選用HashMap來存儲(chǔ)。5.import .*。class UFlashKey implements Comparable { double d=0。UFlashKey(double d){ =d。} public int pareTo(Object b){ UFlashKey st=(UFlashKey)b。if(()==0)return1。else return(int)(()*1000)。} } class UFlash { String name=null。double capacity,price。UFlash(String s,double m,double e){ name=s。capacity=m。price=e。} } public class Xiti5 { public static void main(String args[ ]){ TreeMap treemap= new TreeMap()。String str[]={”U1“,”U2“,”U3“,”U4“,”U5“,”U6“,”U7“,”U8“,”U9“,”U10“}。double capacity[]={1,2,2,4,10,8,4,4,2}。double price[]={30,66,90,56,50,149,120,80,85,65}。UFlash UFlash[]=new UFlash[10]。for(int k=0。k} int number=()。(”樹映射中有“+number+”個(gè)對(duì)象,按容量成績排序:“)。Collection collection=()。Iterator iter=()。while(()){ UFlash stu=()。(”U盤 “++” 容量 “+)。} ()。for(int k=0。k習(xí)題14 1.(1)創(chuàng)建數(shù)據(jù)源選擇“控制面板”→“管理工具”→“ODBC數(shù)據(jù)源”(某些window/xp系統(tǒng),需選擇“控制面板”→“性能和維護(hù)”→“管理工具”→“ODBC數(shù)據(jù)源”)。雙擊ODBC數(shù)據(jù)源圖標(biāo),選擇“系統(tǒng)DSN”或“用戶DSN”,單擊“添加”按鈕,可以創(chuàng)建新的數(shù)據(jù)源。(2)數(shù)據(jù)源選擇驅(qū)動(dòng)程序選擇單擊“添加”按鈕,出現(xiàn)為新增的數(shù)據(jù)源選擇驅(qū)動(dòng)程序界面,如果要訪問Access數(shù)據(jù)庫,選擇Microsoft Acess Driver(*.mdb)。單擊完成按鈕。(3)數(shù)據(jù)源名稱及對(duì)應(yīng)數(shù)據(jù)庫的所在位置在設(shè)置數(shù)據(jù)源具體項(xiàng)目的對(duì)話框,在名稱欄里為數(shù)據(jù)源起一個(gè)自己喜歡的名字。這個(gè)數(shù)據(jù)源就是指某個(gè)數(shù)據(jù)庫。在“數(shù)據(jù)庫選擇”欄中選擇一個(gè)已經(jīng)準(zhǔn)備好的數(shù)據(jù)庫。2.。3.。4.。5.使用預(yù)處理語句不僅減輕了數(shù)據(jù)庫的負(fù)擔(dān),而且也提高了訪問數(shù)據(jù)庫的速度。6.事務(wù)由一組SQL語句組成,所謂事務(wù)處理是指:應(yīng)用程序保證事務(wù)中的SQL語句要么全部都執(zhí)行,要么一個(gè)都不執(zhí)行。步驟:(1)使用setAutoCommit(boolean autoCommit)方法con對(duì)象首先調(diào)用setAutoCommit(boolean autoCommit)方法,將參數(shù)autoCommit取值false來關(guān)閉默認(rèn)設(shè)置:(false)。(2)使用mit()方法。con調(diào)用mit()方法就是讓事務(wù)中的SQL語句全部生效。(3)使用rollback()方法。con調(diào)用rollback()方法撤消事務(wù)中成功執(zhí)行過的SQL語句對(duì)數(shù)據(jù)庫數(shù)據(jù)所做的更新、插入或刪除操作,即撤消引起數(shù)據(jù)發(fā)生變化的SQL語句操作,將數(shù)據(jù)庫中的數(shù)據(jù)恢復(fù)到mi()方法執(zhí)行之前的狀態(tài)。7.。習(xí)題15 1.4種狀態(tài):新建、運(yùn)行、中斷和死亡。2.有4種原因的中斷:JVM將CPU資源從當(dāng)前線程切換給其他線程,使本線程讓出CPU的使用權(quán)處于中斷狀態(tài)。線程使用CPU資源期間,執(zhí)行了sleep(int millsecond)方法,使當(dāng)前線程進(jìn)入休眠狀態(tài)。經(jīng)過參數(shù)millsecond指定的豪秒數(shù)之后,該線程就重新進(jìn)到線程隊(duì)列中排隊(duì)等待CPU資源,以便從中斷處繼續(xù)運(yùn)行。線程使用CPU資源期間,執(zhí)行了wait()方法,使得當(dāng)前線程進(jìn)入等待狀態(tài)。等待狀態(tài)的線程不會(huì)主動(dòng)進(jìn)到線程隊(duì)列中排隊(duì)等待CPU資源,必須由其他線程調(diào)用notify()方法通知它
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1