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

正文內(nèi)容

[教育學(xué)]自考java課后題答案(編輯修改稿)

2025-02-04 20:21 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 JLabel(輸入漢語(yǔ) )。 (label1)。(text1)。 (label2)。(text2)。 add(p1)。add(p2)。 (this)。 (this)。 setSize(200,200)。 setVisible(true)。 validate()。 } public void actionPerformed(ActionEvent e) { if(()==text1) { String word=()。 if((boy)) (男孩 )。 else if((girl)) (女孩 )。 else if((sun)) (太陽(yáng) )。 21 else if((moon)) (月亮 )。 else (沒(méi)有該 Chinese 翻譯 )。 } else if(()==text2) { String word=()。 if((男孩 )) (boy)。 else if((女孩 )) (girl)。 else if((太陽(yáng) )) (sun)。 else if((月亮 )) (moon)。 else (沒(méi)有該 English 翻譯 )。 } } } public class Work5_8 { public static void main(String[] args) { MyWindow win=new MyWindow()。 ()。 } } 添加的單詞 : 男孩 boy 女孩 girl 太陽(yáng) sun 月亮 moon 運(yùn)行結(jié)果: 22 、一個(gè)文本框、一個(gè)文本區(qū)、兩個(gè)按鈕。當(dāng)在文本區(qū)中輸入若干數(shù)后,點(diǎn)擊求和按鈕,在文本框顯示輸入數(shù)的和,標(biāo)簽顯示 “ 輸入數(shù)的和 ” ;點(diǎn)擊求平均值按鈕,在文本框顯示輸入數(shù)的平均值,標(biāo)簽顯示 “ 輸入數(shù)的平均值 ” 。要求文本區(qū)設(shè)有滾動(dòng)條。 import .*。 import .*。 import .*。 import .*。 import .*。 class Window5_9 extends JFrame implements ActionListener { JLabel label。 JTextArea textArea。 JTextField textField。 JButton sumButton,averageButton。 JPanel panelNorth,panelSouth。 Window5_9() { super(第五章,第九題 !)。 setBounds(100,100,350,200)。 label=new JLabel()。 textField=new JTextField(12)。 textArea=new JTextArea()。 sumButton=new JButton(求 和 )。 averageButton=new JButton(平均值 )。 panelNorth=new JPanel()。 panelSouth=new JPanel()。 JScrollPane jsp=new JScrollPane(textArea)。 (CROLLBAR_ALWAYS)。 23 (AL_SCROLLBAR_ALWAYS)。 (this)。 (this)。 (sumButton)。(averageButton)。 (label)。(textField)。 add(panelNorth,)。 add(jsp,)。 add(panelSouth,)。 addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent e) {(0)。}})。 setVisible(true)。 validate()。 } public void actionPerformed(ActionEvent e) { try { String s=()。 String temp=new String()。 StringTokenizer t=new StringTokenizer(s,39。\n39。 ,. )。 int n=()。 int a[]=new int [n]。 for(int i=0。i n。i++) { temp=()。 a[i]=(temp)。 } if(()==sumButton) { ( 輸入數(shù)的和 )。 int sum=0。 for(int i=0。i 。i++) sum=sum+a[i]。 (+sum)。 } else if(()==averageButton) { 24 (輸入數(shù)的平均值 )。 int sum=0。 for(int i=0。i 。i++) sum=sum+a[i]。 double average=*sum/()。 (+average)。 } } catch(NumberFormatException ed) { (請(qǐng)出入數(shù)字字符! )。 } } } public class Work5_9 { public static void main(String args[]) { Window5_9 win=new Window5_9()。 } } . 25 嵌套布局,用了大部分的 GridLayout布局 import .*。 import .*。 class Window5_101 extends JFrame { JScrollPane jsp1,jsp5。 JPanel panel2,panel3,panel4,panel6。//整體布局部件 JTextArea jsp1_Text,jsp5_Text。 JLabel panel2_Label。 JTextField panel2_Field。 JPanel panel3_p1,panel3_p2,panel4_p1,panel4_p2,panel4_p3,panel6_p1,panel6_p2,panel6_p3。 JButton panel4_b1,panel4_b2。 Window5_101() { super(第五章,第十題 )。 setSize(600,120)。 setLayout(new GridLayout(2,3))。//設(shè)置整 體布局為表格布局, 2行 3列 setVisible(true)。 jsp1_Text=new JTextArea(文本區(qū)(帶滾動(dòng)條) )。 JScrollPane jsp1=new JScrollPane(jsp1_Text)。//第一個(gè) panel2=new JPanel()。 panel2_Label=new JLabel(標(biāo)簽 )。 panel2_Field=new JTextField(文本框 )。 panel3=new JPanel()。 panel3_p1=new JPanel()。 panel3_p2=new JPanel()。 panel4=new JPanel()。 panel4_b1=new JButton(按鈕 )。 panel4_b2=new JButton(按鈕 )。 panel4_p1=new JPanel()。 panel4_p2=new JPanel()。 panel4_p3=new JPanel()。 jsp5_Text=new JTextArea(文本區(qū)(帶滾動(dòng)條) )。 JScrollPane jsp5=new JScrollPane(jsp5_Text)。 panel6=new JPanel()。 26 panel6_p1=new JPanel()。 panel6_p2=new JPanel()。 panel6_p3=new JPanel()。 //設(shè)置滾動(dòng)條為一直可見(jiàn) (SCROLLBAR_ALWAYS)。 (TAL_SCROLLBAR_ALWAYS)。 (SCROLLBAR_ALWAYS)。 (TAL_SCROLLBAR_ALWAYS)。 (new GridLayout(2,1))。//第二個(gè)面板表格布局, 2行 1列 (panel2_Label)。(panel2_Field)。 (new GridLayout(1,2))。//第三個(gè)面板表格布局, 1行 2列 ()。 ()。 (panel3_p1)。(panel3_p2)。 (new GridLayout(1,3))。//第四個(gè)面板表格布局, 1行 3列 (new GridLayout(2,1))。//第四個(gè)面板中的第一個(gè)面板 ,2 行 1列 (panel4_b1)。(panel4_b2)。 ()。 ()。 (panel4_p1)。(panel4_p2)。(panel4_p3)。 (new GridLayout(1,3))。//第六個(gè)面板表格布局, 1行 3列 ()。 ()。 ()。 27 (panel6_p1)。(panel6_p2)。(panel6_p3)。 add(jsp1)。 add(panel2)。 add(panel3)。 add(panel4)。 add(jsp5)。 add(panel6)。 validate()。 } } public class Work5_101 { public static void main(String args[]) { Window5_101 win=new Window5_101()。 ()。 } } null布局,用準(zhǔn)確的坐標(biāo)和長(zhǎng)寬 import .*。 import .*。 class Window5_10 extends JFrame { JTextArea textArea1,textArea8。 JButton button2,button3。 JPanel panel4,panel5,panel9,panel10,panel11,panel12,panel13。 JLabel label6。 JTextField textField7。 Window5_10() { super(第五章,第十題 )。 setLayout(null)。 setSize(910,200)。 28 textArea1=new JTextArea()。 button2=new JButton(按鈕 )。 button3=new JButton(按鈕 )。 panel4=new JPanel()。 panel5=new JPanel()。 label6=new JLabel(標(biāo)簽 )。 textField7=new JTextField(文本框 )。 textArea8=new JTextArea()。 panel9=new JPanel()。 panel10=new JPanel()。 panel11=new JPanel()。 panel12=new JPanel()。 panel13=new JPanel()。 JScrollPane jsp1=new JScrollPane(textArea1)。 JScrollPane jsp8=new JScrollPane(textArea8)。 //設(shè)置滾動(dòng)條為一直可見(jiàn) (SCROLLBAR_ALWAYS)。 (TAL_SCROLLBAR_ALWAYS)。 (SCROLLBAR_ALWAYS)。 (TAL_SCROLLBAR_ALWAYS)。 //添加各個(gè)組件 add(jsp1)。 add(bu
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1