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

正文內(nèi)容

java課程設(shè)計(jì)---科學(xué)計(jì)算器-java-文庫吧

2024-12-30 06:31 本頁面


【正文】 = new JMenuItem(關(guān)于計(jì)算器 (A))。 (new Font(宋體 ,12))。 (new Font(宋體 ,12))。 bgb = new ButtonGroup()。//選項(xiàng)組 (editItem1)。 (editItem2)。 (seeItem1)。 (seeItem2)。 ()。//添加一條分割線 (seeItem3)。 (help1)。 ()。//添加一條分割線 (help2)。 (menu1)。 (menu2)。 (menu3)。 (myBar)。 numActionListener = new Num()。//實(shí)現(xiàn)數(shù)字監(jiān)聽 濟(jì)南大學(xué)課程設(shè)計(jì) 6 /** * 文本域,即為計(jì)算器的屏幕顯示區(qū)域 */ tf = new JTextField()。 (false)。//文本區(qū)域不可編輯 ()。//文本區(qū)域的背景色 ()。//文字右對(duì)齊 (0)。 (())。 init()。//對(duì)計(jì)算器進(jìn)行初始化 } /** * 初始化操作 * 添加按鈕 */ private void init(){ addButton(panel1, Backspace, new Clear(), )。 addButton(panel1, CE, new Clear(), )。 addButton(panel1, C, new Clear(), )。 addButton(panel2, 1/x, new Signs(), )。 addButton(panel2, log, new Signs(), )。 addButton(panel2, 7, numActionListener, )。 addButton(panel2, 8, numActionListener, )。 addButton(panel2, 9, numActionListener, )。 addButton(panel2, 161。194。, new Signs(), )。 addButton(panel2, n!, new Signs(), )。 addButton(panel2, sqrt, new Signs(), )。 addButton(panel2, 4, numActionListener, )。 addButton(panel2, 5, numActionListener, )。 addButton(panel2, 6, numActionListener, )。 addButton(panel2, 161。193。, new Signs(), )。 addButton(panel2, sin, new Signs(), )。 addButton(panel2, x^2, new Signs(), )。 addButton(panel2, 1, numActionListener, )。 addButton(panel2, 2, numActionListener, )。 addButton(panel2, 3, numActionListener, )。 addButton(panel2, , new Signs(), )。 addButton(panel2, cos, new Signs(), )。 濟(jì)南大學(xué)課程設(shè)計(jì) 7 addButton(panel2, x^3, new Signs(), )。 addButton(panel2, 0, numActionListener, )。 addButton(panel2, /+, new Clear(), )。 addButton(panel2, ., new Dot(), )。 addButton(panel2, +, new Signs(), )。 addButton(panel2, tan, new Signs(), )。 addButton(panel2, %, new Signs(), )。 addButton(panel2, π, numActionListener, )。 addButton(panel2, e, numActionListener, )。 addButton(panel2, `, new Signs(), )。 addButton(panel2, =, new Signs(), )。 JButton btns = new JButton(計(jì)算器 )。 (())。 (false)。//按鈕不可操作 (new Dimension(20, 20))。 (btns)。//加入按鈕 addButton(panel3, MC, null, )。 addButton(panel3, MR, null, )。 addButton(panel3, MS, null, )。 addButton(panel3, M+, null, )。 (panel1, )。 (panel2, )。 (tf, )。 (panel3, )。 (panel4)。 pack()。//調(diào)整此窗口的大小,以適合其子組件的首選大小和布局 (false)。//窗口不可改變大小 (500, 200)。//將組件移到新位置 ()。 } /** * 統(tǒng)一設(shè)置按鈕的的使用方式 * @param panel * @param name * @param action * @param color */ private void addButton(JPanel panel, String name, ActionListener action, 濟(jì)南大學(xué)課程設(shè)計(jì) 8 Color color){ JButton bt = new JButton(name)。 (bt)。//在面板上增加按鈕 (color)。//設(shè)置前景(字體)顏色 (action)。//增加監(jiān)聽事件 } /** * 計(jì)算器的基礎(chǔ)操作( + 161。193。 161。194。) * @param x */ private void getResult (double x){ if(oper == +){result += x。} else if(oper == ){result = x。} else if(oper == 161。193。){result *= x。} else if(oper == 161。194。){result /= x。} else if(oper == =){result = x。} ((result))。 } /** * 運(yùn)算符號(hào)的事件監(jiān)聽 */ class Signs implements ActionListener{ public void actionPerformed(ActionEvent e) { /* * 用 ActionEvent對(duì)象的 getActionCommand()方法 * 取得與引發(fā)事件對(duì)象相關(guān)的字符串 */ String str = ()。 /* sqrt求平方根 */ if((sqrt)){ double i = (())。 if(i=0){ /* * () 轉(zhuǎn)換為字符串 * () 按要求保留四位小數(shù) * () 求算數(shù)平方根 */ ((((i))))。 } else{ (負(fù)數(shù)不能開平方根 )。 } } 濟(jì)南大學(xué)課程設(shè)計(jì) 9 /* log求常用對(duì)數(shù) */ else if((log)){ double i = (())。 if(i0){ ((((i))))。 }else{ (負(fù)數(shù)不能求對(duì)數(shù) )。 } } /* %求百分比 */ else if((%)){ (((()) / 100))。 } /* 1/x求倒數(shù) */ else if((1/x)){ if((()) == 0){ (除數(shù)不能為零 )。 }else{ ((1 / (())))。 } } /* sin求正弦函數(shù) */ else if((sin)){ double i = (())。 ((
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1