📄 jisuanqi.java
字号:
/*
* Jisuanqi.java
*
* Created on 2007年8月4日, 下午8:34
*/
package org.Adam;
import java.lang.String;
import java.lang.Long;
/**
*
* @author Administrator
*/
public class Jisuanqi extends javax.swing.JFrame {
private int temp=0;
private float result=0;
private float fnumber=0,bnumber=0;
/** Creates new form Jisuanqi */
public Jisuanqi() {
initComponents();
this.setLocationRelativeTo(this);
}
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc=" 生成的代码 ">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jButtonSeven = new javax.swing.JButton();
jButtonEight = new javax.swing.JButton();
jButtonNine = new javax.swing.JButton();
jButtonFour = new javax.swing.JButton();
jButtonFive = new javax.swing.JButton();
jButtonSix = new javax.swing.JButton();
jButtonOne = new javax.swing.JButton();
jButtonTwo = new javax.swing.JButton();
jButtonThree = new javax.swing.JButton();
jButtonZero = new javax.swing.JButton();
jButtonDian = new javax.swing.JButton();
jButtonAdd = new javax.swing.JButton();
jButtonJian = new javax.swing.JButton();
jButtonCheng = new javax.swing.JButton();
jButtonChu = new javax.swing.JButton();
jButtonIs = new javax.swing.JButton();
jTextFieldMessage = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("\u8ba1\u7b97\u5668");
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("\u8ba1\u7b97\u5668"));
jButtonSeven.setText("7");
jButtonSeven.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonSevenActionPerformed(evt);
}
});
jButtonEight.setText("8");
jButtonEight.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonEightActionPerformed(evt);
}
});
jButtonNine.setText("9");
jButtonNine.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonNineActionPerformed(evt);
}
});
jButtonFour.setText("4");
jButtonFour.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonFourActionPerformed(evt);
}
});
jButtonFive.setText("5");
jButtonFive.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonFiveActionPerformed(evt);
}
});
jButtonSix.setText("6");
jButtonSix.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonSixActionPerformed(evt);
}
});
jButtonOne.setText("1");
jButtonOne.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOneActionPerformed(evt);
}
});
jButtonTwo.setText("2");
jButtonTwo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonTwoActionPerformed(evt);
}
});
jButtonThree.setText("3");
jButtonThree.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonThreeActionPerformed(evt);
}
});
jButtonZero.setText("0");
jButtonZero.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonZeroActionPerformed(evt);
}
});
jButtonDian.setText(".");
jButtonDian.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonDianActionPerformed(evt);
}
});
jButtonAdd.setText("+");
jButtonAdd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonAddActionPerformed(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);
}
});
jButtonIs.setText("=");
jButtonIs.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonIsActionPerformed(evt);
}
});
jTextFieldMessage.setEditable(false);
jTextFieldMessage.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
jTextFieldMessage.setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(0, 0, 255)));
jButton1.setText("\u6e05\u7a7a");
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
}
});
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(org.jdesktop.layout.GroupLayout.LEADING, jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1Layout.createSequentialGroup()
.add(jButtonZero)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonDian)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonIs)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonChu))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1Layout.createSequentialGroup()
.add(jButtonOne)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonTwo)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonThree)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonCheng))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1Layout.createSequentialGroup()
.add(jButtonFour)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonFive)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonSix)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonJian))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1Layout.createSequentialGroup()
.add(jButtonSeven)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonEight)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonNine)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButtonAdd))
.add(org.jdesktop.layout.GroupLayout.LEADING, jTextFieldMessage))
.addContainerGap(31, Short.MAX_VALUE))
);
jPanel1Layout.linkSize(new java.awt.Component[] {jButtonAdd, jButtonCheng, jButtonChu, jButtonDian, jButtonEight, jButtonFive, jButtonFour, jButtonIs, jButtonJian, jButtonNine, jButtonOne, jButtonSeven, jButtonSix, jButtonThree, jButtonTwo, jButtonZero}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -