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

正文內(nèi)容

chapjava概述ppt課件-資料下載頁(yè)

2025-05-05 12:01本頁(yè)面
  

【正文】 14. public void actionPerformed(ActionEvent e) 15. { 16. (()+,wele you!)。 17. } 18. } Application圖形界面輸入輸出 ? Applet只能在圖形界面下工作, Application需要首先創(chuàng)建自己的圖形用戶界面??匆粋€(gè)例子 ? 幾點(diǎn)說(shuō)明 –要加載 –要定義 Frame類的子類 – Frame類的子類要定義構(gòu)造函數(shù),此函數(shù)完成主要工作 –方法 setLayout(new FlowLayout)完成個(gè)控件布局 –方法 setSize(300,300)設(shè)置窗框大小 –方法 Show()把窗框顯示出來(lái) import .*。import .*。 class FrameInOut extends Frame implements ActionListener { Label prompt。 TextField input,output。 Button btn。 FrameInOut() { super(java appliction graphics)。 prompt=new Label(input your name)。 input=new TextField(6)。 output=new TextField(20)。 btn=new Button(close)。 setLayout(new FlowLayout())。 add(prompt)。 add(input)。 add(output)。 add(btn)。 (this)。 (this)。 setSize(300,200)。 show()。//setVisible(true)。 } public void actionPerformed(ActionEvent e) { if(()==input) (()+,wele you!)。 else {dispose()。 (0)。 } } } public class ApplicationGraphicsinout { public static void main(String args[]) { new FrameInOut()。 } } 字符界面的輸入輸出 ? 字符模式的用戶界面,用戶通過(guò)字符串向程序發(fā)出命令 ? Applet程序只能在圖形用戶界面上工作,所以只有 Application可以實(shí)現(xiàn)字符界面的輸入輸出 ? 幾點(diǎn)說(shuō)明 – 輸入字符的方法: c=( char) System. () 其中 c是字符型變量 – 輸入字符串的方法: BufferReader in=new BufferReader(new InputStreamReader())。s=()。 s為字符串變量 – 字符或字符串輸入都必須放在異常處理語(yǔ)句中,格式為:try{ }catch(IOException e){} import .*。 public class chap21 { public static void main(String[] args) { char c。 (Enter a character please:)。 try{ c=(char)()。 }catch(IOException e) { (Sorry, it has something wrong with the reception)。 } (you39。ve entered character+c)。 } } 接收字符 接收字符串 import .*。 public class ApplicationLineIn { public static void main(String args[]) { String s=。 (please enter a string:)。 try{BufferedReader iner =new BufferedReader(new InputStreamReader())。 s=()。}catch(IOException e){} (you39。ve entered string:+s)。 } } ? 掌握 java開(kāi)發(fā)環(huán)境安裝,使用 ? 掌握 java application和 applet程序的結(jié)構(gòu) 運(yùn)行方式 掌握已出現(xiàn)的語(yǔ)法
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1