所选用的编译工具为NetBeans
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package jianpan2;
/**
*
* @author Administrator
*/
public class KuangJia extends javax.swing.JFrame {
/**
* Creates new form KuangJia
*/
// private final double INF = 0x7f7f7f7f;
private String str="";
private double num1=0,num2=0;
private int result=0;
private int FuHao=0,Diansum=0;
public KuangJia() {
initComponents();
}
/**
* 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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jButton0 = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
jButtonDIAN = new javax.swing.JButton();
jButtonDENG = new javax.swing.JButton();
jButtonJIA = new javax.swing.JButton();
jButtonJIAN = new javax.swing.JButton();
jButtonCHENG = new javax.swing.JButton();
jButtonCHU = new javax.swing.JButton();
jButtonC = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jButton9 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton0.setText("0");
jButton0.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton0ActionPerformed(evt);
}
});
jTextField1.setEditable(false);
jTextField1.setFont(new java.awt.Font("宋体", 1, 24)); // NOI18N
jTextField1.setText("0");
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
jButtonDIAN.setText(".");
jButtonDIAN.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonDIANActionPerformed(evt);
}
});
jButtonDENG.setText("=");
jButtonDENG.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonDENGActionPerformed(evt);
}
});
jButtonJIA.setText("+");
jButtonJIA.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonJIAActionPerformed(evt);
}
});
jButtonJIAN.setText("-");
jButtonJIAN.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonJIANActionPerformed(evt);
}
});
jButtonCHENG.setText("*");
jButtonCHENG.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCHENGActionPerformed(evt);
}
});
jButtonCHU.setText("/");
jButtonCHU.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCHUActionPerformed(evt);
}
});
jButtonC.setText("C");
jButtonC.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonCActionPerformed(evt);
}
});
jButton1.setText("1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("2");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setText("3");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton4.setText("4");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt