亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? calculator.txt

?? 使用JAVA編寫的計算器程序.進行+ - * /運算
?? TXT
?? 第 1 頁 / 共 3 頁
字號:
/**
 * Calculator
 * A shareware calculator
 *
 * @author {@link http://blog.csdn.net/hongweijin Bingbing Li}
 *
 * @recitation 0101 Matt Carlson
 *
 * @date 12/7/2005 12:08AM
 *
 */
 
 import javax.swing.*;
 import javax.swing.border.*;
 import java.awt.*;
 import java.awt.event.*;
 
 public class Calculator extends JFrame implements ActionListener
 {
     public static final int WIDTH = 800;            // width of the window                  
     public static final int HEIGHT = 600;           // height of the window                 
     public static final int BUTTON_WIDTH = 80;      // width of the buttons                 
     public static final int BUTTON_HEIGHT = 60;     // height of the buttons                
                                                                                             
     private CardLayout dealer;                      // card layout                          
     private JPanel        deckPanel;                   // used to card layout                  
                                                                                             
     private JTextField result;                      // the calculate result                 
     private JCheckBoxMenuItem scientificMode;       // the menu item of the mode            
                                                                                             
     private Box vPanel1;                            // the first line buttons of the        
                                                        // scientific mode.                     
                                                                                             
     private JButton mod;                            // the modular button                   
     private JButton xey;                            // the button of Yth root of X          
     private JButton ms;                             // save button                          
    private JButton mr;                             // release the stored value             
     private    JButton mc;                             // clear the stored value               
                                                                                             
     private double head = 0.0;                      // the first number of the equation     
     private double tail = 0.0;                      // the second number of the equation    
                                                                                             
     private boolean substitution = true;            // whether substituted the answer or not
                                                                                             
     private String operatedCommand = 'NOTHING';     // the current operated command         
     private String preOperatedCommand = 'NOTHING';  // remember the pre-operated command
     
     private double variableMemory = 0.0;            // the variable of the memory
     
     private JButton jButtonR;                       // the register's button
     private JButton jButtonE;                       // the edit's button
     
     private JTextField nameField;                   // the field of the name
     private JTextField countryField;                // the field of the country
     private JTextField zipField;                    // the field of the zip
     private JTextField stateField;                  // the field of the state
     private JTextField cityField ;                  // the field of the city
     private JTextField streetAddressField;          // the field of the address
     
     private JTextField first;                       // the first part of the key
     private JTextField second;                      // the second part of the key
     private JTextField third;                       // the third part of the key
     private JTextField fourth;                      // the fourth part of the key
     
     
     public Calculator()
     {
         setSize(WIDTH, HEIGHT);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setTitle('Normal Calculator');
         
         Container contentPre = getContentPane();    // the container of the window
         
         dealer = new CardLayout();                  // create a new card layout
         deckPanel = new JPanel();                    
         deckPanel.setLayout(dealer);
         
         Box content = Box.createVerticalBox();      // create a new vertical Box 
         
         Box registration = Box.createVerticalBox();
         
         /****************************************************
         *    menu
         *   file
         *****************************************************/
         JMenu fileMenu = new JMenu('File');         
         JMenuItem exitItemOfFile = new JMenuItem('Exit');
         exitItemOfFile.addActionListener(this);
         fileMenu.add(exitItemOfFile);
         /**
         *    menu
         *   settings
         */
         JMenu settingsMenu = new JMenu('Settings');
         JMenuItem registrationInfo = new JMenuItem('Registration Info');
         registrationInfo.addActionListener(this);
         settingsMenu.add(registrationInfo);
         
         scientificMode = new JCheckBoxMenuItem('Scientific Mode');
         scientificMode.addActionListener(this);
         settingsMenu.add(scientificMode);
         
         JMenuBar jMenuBar = new JMenuBar();
         jMenuBar.add(fileMenu);
         jMenuBar.add(settingsMenu);
         setJMenuBar(jMenuBar);
         
         /****************************************************
         *    textFiled panel
        *****************************************************/
        
        result = new JTextField('0');                     // the initiated value of the answer
        result.setBackground(Color.CYAN);                 // set the back ground color with cyan
        result.setHorizontalAlignment(JTextField.RIGHT);  // set the horizontal alignment  
        
        
        content.add(result);
             
         content.add(paintButtons());
         
         deckPanel.add('cal', content);                    // add the calculators card to the layout
         
         registration.add(paintRegistration());            // add the register window
         
         deckPanel.add('reg', registration);               // add the register window to the layout
         
         contentPre.add(deckPanel);                   // add the cards to the container
     }
     
     /**
     * paint the buttons of the two models.
     *
     */
     public Box paintButtons() 
     {
         /****************************************************
        *    Buttons
        *****************************************************/
        
         /**
         *    line1
         */ 
         vPanel1 = Box.createVerticalBox();                                      
         
         // add the backwards's button                                                                           
         JButton backwards = new JButton('1/X');                                     
         backwards.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));       
         backwards.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));     
         backwards.addActionListener(this);                                          
         vPanel1.add(backwards);    
                                                          
         // add the factorial button                                                                            
         JButton factorial = new JButton('X!');                                      
         factorial.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));       
         factorial.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));     
         factorial.addActionListener(this);                                          
         vPanel1.add(factorial);                                                     
         
         // add the square's button                                                                            
         JButton square = new JButton('<html>X<sup>2</sup></html>');                 
         square.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));          
         square.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));        
         square.addActionListener(this);
         square.setActionCommand('sqr');                                             
         vPanel1.add(square);                                                        
         
         // add the square root's button                                                                            
         JButton squareRoot = new JButton('\u221a');                                 
         squareRoot.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));      
         squareRoot.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));    
         squareRoot.addActionListener(this);                                         
         vPanel1.add(squareRoot);                                                    
               
         // add the power's button                                                                       
         JButton power = new JButton('<html>X<sup>Y</sup></html>');                  
         power.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));           
         power.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));         
         power.addActionListener(this);   
         power.setActionCommand('pow');                                           
         vPanel1.add(power);                                                         
                  
         /**
         *    line2
         */
         Box vPanel2 = Box.createVerticalBox();
         
         // add the modular button 
         mod = new JButton('Mod');
         mod.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         mod.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         mod.addActionListener(this);
         vPanel2.add(mod);
                  
         // add the seven button 
         JButton seven = new JButton('7');
         seven.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         seven.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         seven.addActionListener(this);
         vPanel2.add(seven); 
         
         // add the four button 
         JButton four = new JButton('4');
         four.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         four.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         four.addActionListener(this);
         vPanel2.add(four); 
         
         // add the one button 
         JButton one = new JButton('1');
         one.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         one.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         one.addActionListener(this);
         vPanel2.add(one); 
         
         // add the zero button 
         JButton zero = new JButton('0');
         zero.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         zero.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         zero.addActionListener(this);
         vPanel2.add(zero);
         
         /**
         *    line3
         */
         Box vPanel3 = Box.createVerticalBox();
         
         // add the Yth root of X button 
         xey = new JButton('XeY');
         xey.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         xey.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         xey.addActionListener(this);
         vPanel3.add(xey);
              
          // add the eight button 
         JButton eight = new JButton('8');
         eight.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
        eight.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         eight.addActionListener(this);
         vPanel3.add(eight); 
         
         // add the five button 
         JButton five = new JButton('5');
         five.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         five.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         five.addActionListener(this);
         vPanel3.add(five); 
         
         // add the two button 
         JButton two = new JButton('2');
         two.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         two.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         two.addActionListener(this);
         vPanel3.add(two); 
         
         // add the dot button 
         JButton dot = new JButton('.');
         dot.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         dot.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         dot.addActionListener(this);
         vPanel3.add(dot);      
         
         /**
         *    line4
         */
         Box vPanel4 = Box.createVerticalBox();
         
         // add the MS button 
         ms = new JButton('MS');
         ms.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
        ms.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         ms.addActionListener(this);
         vPanel4.add(ms);
             
         // add the nine button 
         JButton nine = new JButton('9');
         nine.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         nine.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         nine.addActionListener(this);
         vPanel4.add(nine); 
         
         // add the six button 
         JButton six = new JButton('6');
         six.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         six.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         six.addActionListener(this);
         vPanel4.add(six); 
         
         // add the three button 
         JButton three = new JButton('3');
         three.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         three.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         three.addActionListener(this);
         vPanel4.add(three); 
         
         // add the plusMinus button 
         JButton plusMinus = new JButton('\u00b1');
         plusMinus.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         plusMinus.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         plusMinus.addActionListener(this);
         vPanel4.add(plusMinus);     
         
         /**
         *    line5
         */
         Box vPanel5 = Box.createVerticalBox();
         
         // add the MR button 
         mr = new JButton('MR');
         mr.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         mr.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         mr.addActionListener(this);
         vPanel5.add(mr);
         
         // add the division button 
         JButton division = new JButton('\u00F7');
         division.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         division.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
         division.addActionListener(this);
         vPanel5.add(division); 
         
         // add the multiplication button 
         JButton multiplication = new JButton('\u00d7');
         multiplication.setMaximumSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产精品中文字幕| av影院午夜一区| 亚洲图片欧美视频| 久久精品久久综合| 日韩欧美电影一二三| 欧美国产日韩a欧美在线观看 | 日韩一区二区三区电影| 狠狠狠色丁香婷婷综合激情| 亚洲一区二区三区影院| 日韩一区中文字幕| 亚洲一线二线三线久久久| 韩国视频一区二区| 欧美激情一区二区三区不卡| 成人一道本在线| 亚洲欧美激情视频在线观看一区二区三区 | 日韩专区中文字幕一区二区| 制服丝袜亚洲精品中文字幕| 精品一区二区三区免费播放| 国产清纯白嫩初高生在线观看91| 粉嫩绯色av一区二区在线观看| 亚洲天堂2016| 欧美一级搡bbbb搡bbbb| 日韩精品一区二区三区四区| 国产大陆精品国产| 国产精品久久久久影院色老大 | 国产盗摄视频一区二区三区| 国产精品护士白丝一区av| 欧洲精品视频在线观看| 麻豆成人久久精品二区三区红 | 国产精品911| 亚洲国产综合在线| 欧美精品一区二区三区在线播放 | 亚洲日本va午夜在线电影| 欧美日韩中字一区| 国产乱对白刺激视频不卡| 亚洲精品写真福利| 精品处破学生在线二十三| 色综合一区二区三区| 久久国内精品视频| 亚洲久草在线视频| 精品成人免费观看| 欧美日韩综合色| 国产成人av资源| 日韩电影在线一区二区| 国产精品不卡在线观看| 欧美r级在线观看| 91福利精品第一导航| 国产精品原创巨作av| 天堂成人免费av电影一区| 国产精品午夜久久| 精品免费国产一区二区三区四区| 91丨porny丨在线| 国产精品一线二线三线| 青椒成人免费视频| 亚洲一区中文日韩| 自拍偷拍国产亚洲| 久久精品视频在线看| 日韩视频在线你懂得| 欧美日韩一级片在线观看| 99精品一区二区三区| 国产高清久久久| 久久99九九99精品| 男女男精品视频网| 日韩黄色免费电影| 亚洲成人综合网站| 亚洲国产欧美日韩另类综合| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 国产成人综合视频| 另类的小说在线视频另类成人小视频在线| 亚洲欧美日韩在线| 成人免费一区二区三区在线观看| 久久先锋影音av| 精品国产一区二区亚洲人成毛片 | 另类小说视频一区二区| 日韩不卡免费视频| 亚洲乱码日产精品bd| 亚洲成av人影院在线观看网| 国产精品久久99| 日韩欧美一区电影| 91精品国产一区二区三区| 欧美色国产精品| 欧美揉bbbbb揉bbbbb| 欧美自拍偷拍一区| 欧美网站一区二区| 91视频xxxx| 在线免费亚洲电影| 欧美日韩中文字幕一区二区| 欧美日韩色综合| 欧美精品一卡二卡| 日韩欧美亚洲另类制服综合在线| 欧美一区二区视频免费观看| 91精品国产aⅴ一区二区| 欧美一区二区在线免费观看| 日韩视频一区二区| 久久久激情视频| 国产精品污污网站在线观看| 一区在线中文字幕| 亚洲与欧洲av电影| 婷婷综合在线观看| 黄色精品一二区| 国产不卡免费视频| 亚洲美女一区二区三区| 久久久精品影视| 三级精品在线观看| 91片黄在线观看| 欧美日韩激情在线| 成人欧美一区二区三区视频网页 | 亚洲mv大片欧洲mv大片精品| 亚洲成a人v欧美综合天堂下载| 日韩精品一级中文字幕精品视频免费观看 | 久久福利资源站| 国产白丝网站精品污在线入口| 成人免费毛片app| 欧美视频在线观看一区二区| 日韩一卡二卡三卡四卡| 久久久久一区二区三区四区| 亚洲第一福利一区| 国产精品初高中害羞小美女文| 国产91精品精华液一区二区三区| 亚洲一区在线播放| 久久99久久久欧美国产| 国产成人av影院| 欧美无乱码久久久免费午夜一区 | 日本欧美韩国一区三区| 国产大陆亚洲精品国产| 欧美丝袜丝交足nylons| 精品第一国产综合精品aⅴ| 亚洲三级视频在线观看| 三级影片在线观看欧美日韩一区二区| 国产一区二区日韩精品| 欧美色图免费看| 久久久久久久久久久99999| 亚洲日本va午夜在线电影| 麻豆91小视频| 欧洲av在线精品| 欧美激情一区二区三区全黄| 视频一区中文字幕国产| va亚洲va日韩不卡在线观看| 日韩一区二区影院| 亚洲精品福利视频网站| 国产精品夜夜嗨| 7799精品视频| 亚洲精品美腿丝袜| 国产福利91精品| 欧美一区二区私人影院日本| 亚洲欧洲制服丝袜| 国内精品第一页| 337p亚洲精品色噜噜噜| 玉足女爽爽91| av亚洲产国偷v产偷v自拍| 日韩精品一区二区三区蜜臀| 亚洲国产成人av| 色先锋资源久久综合| 国产精品午夜在线| 国产一区二区看久久| 日韩欧美黄色影院| 天天射综合影视| 国产精品久久久久9999吃药| 另类综合日韩欧美亚洲| 欧美日韩成人综合在线一区二区| 亚洲欧美日韩一区二区| 成人中文字幕电影| 国产日本欧美一区二区| 国产一区二区三区免费在线观看| 日韩三级.com| 麻豆精品国产91久久久久久| 欧美日韩免费一区二区三区| 亚洲精品午夜久久久| 在线亚洲精品福利网址导航| 亚洲人xxxx| 欧洲一区二区三区在线| 亚洲精品乱码久久久久久| 91国偷自产一区二区使用方法| 中文字幕一区二区5566日韩| 国产福利精品一区二区| 中文av一区特黄| 99久久精品情趣| 亚洲综合网站在线观看| 欧美亚洲高清一区二区三区不卡| 亚洲乱码国产乱码精品精小说 | 精品免费一区二区三区| 国产综合久久久久久鬼色| 精品日韩av一区二区| 国产一区二区三区四| 国产亚洲欧洲997久久综合 | 国产嫩草影院久久久久| 国产成人精品一区二区三区四区 | 欧美日韩卡一卡二| 婷婷丁香久久五月婷婷| 日韩欧美一区二区在线视频| 国产综合成人久久大片91| 国产日本亚洲高清| 色视频一区二区| 奇米精品一区二区三区在线观看 | 国产揄拍国内精品对白| 最新久久zyz资源站| 色天天综合色天天久久| 视频一区在线播放| 精品成人在线观看| 99re视频精品|