• 大小: 35KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-12
  • 语言: 其他
  • 标签: 计算器  

资源简介

NetBeans制作的计算器 实现加减乘除等运算

资源截图

代码片段和文件信息

/*
 * To change this template choose Tools | Templates
 * and open the template in the editor.
 */
package calculator;

import javax.swing.JButton;

/**
 *
 * @author Administrator
 */
public class CalculatorJframe extends javax.swing.Jframe {

    private expression exp;
    private boolean preBtnIsSign = false;

    /**
     * Creates new form CalculatorJframe
     */
    public CalculatorJframe() {
        initComponents();
        //this.setLocation(250 100);
        exp=new expression();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings(“unchecked“)
    // //GEN-BEGIN:initComponents
    private void initComponents() {

        txt_show = new javax.swing.JTextField();
        btn_num1 = new javax.swing.JButton();
        btn_num2 = new javax.swing.JButton();
        btn_num3 = new javax.swing.JButton();
        btn_num4 = new javax.swing.JButton();
        btn_num5 = new javax.swing.JButton();
        btn_num6 = new javax.swing.JButton();
        btn_num7 = new javax.swing.JButton();
        btn_num8 = new javax.swing.JButton();
        btn_num9 = new javax.swing.JButton();
        btn_c = new javax.swing.JButton();
        btn_add = new javax.swing.JButton();
        btn_divi = new javax.swing.JButton();
        btn_del = new javax.swing.JButton();
        btn_mult = new javax.swing.JButton();
        btn_subt = new javax.swing.JButton();
        btn_equal = new javax.swing.JButton();
        btn_num0 = new javax.swing.JButton();
        btn_point = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        txt_show.setFont(new java.awt.Font(“宋体“ 0 24)); // NOI18N
        txt_show.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txt_show.setText(“0“);
        txt_show.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        btn_num1.setText(“1“);
        btn_num1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_numActionPerformed(evt);
            }
        });

        btn_num2.setText(“2“);
        btn_num2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_numActionPerformed(evt);
            }
        });

        btn_num3.setText(“3“);
        btn_num3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_numActionPerformed(evt);
            }
        });

        btn_num4.setText(“4“);
        btn_num4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3731  2015-07-05 08:27  02-zhongruyi\build.xml

     文件         85  2015-06-28 20:00  02-zhongruyi\manifest.mf

     文件          0  2015-07-05 09:36  02-zhongruyi\build\classes\.netbeans_automatic_build

     文件          0  2015-07-05 09:36  02-zhongruyi\build\classes\.netbeans_update_resources

     文件        806  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$1.class

     文件        808  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$10.class

     文件        808  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$11.class

     文件        808  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$12.class

     文件        808  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$13.class

     文件        808  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$14.class

     文件        808  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$15.class

     文件        808  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$16.class

     文件        808  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$17.class

     文件        808  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$18.class

     文件        572  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$19.class

     文件        806  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$2.class

     文件        806  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$3.class

     文件        806  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$4.class

     文件        806  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$5.class

     文件        806  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$6.class

     文件        806  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$7.class

     文件        806  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$8.class

     文件        806  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe$9.class

     文件      11036  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe.class

     文件      16564  2015-07-05 11:35  02-zhongruyi\build\classes\calculator\CalculatorJframe.form

     文件       2052  2015-07-05 11:48  02-zhongruyi\build\classes\calculator\expression.class

     文件      78054  2015-07-05 08:27  02-zhongruyi\nbproject\build-impl.xml

     文件        475  2015-07-05 08:27  02-zhongruyi\nbproject\genfiles.properties

     文件       2345  2015-07-05 08:27  02-zhongruyi\nbproject\project.properties

     文件        520  2015-07-05 08:27  02-zhongruyi\nbproject\project.xml

............此处省略16个文件信息

评论

共有 条评论