CALCULADORA JAVA (SEM OS FORMS)
Autor: Marco Aurelio | Publicado: 2012-11-10T03:47:00-08:00


/*
&nbsp;* To change this template, choose Tools | Templates
&nbsp;* and open the template in the editor.
&nbsp;*/

/*
&nbsp;* Calculadora.java
&nbsp;*
&nbsp;* Created on 27/08/2012, 19:57:14
&nbsp;*/
package calculadora;

import javax.swing.JOptionPane;

/**
&nbsp;*
&nbsp;* @author mapsilva
&nbsp;*/
public class Calculadora extends javax.swing.JFrame {
&nbsp; &nbsp; private double memoria = 0;
&nbsp; &nbsp; private String tela;
&nbsp; &nbsp; private int oper = 0;
&nbsp; &nbsp; private boolean limpa;
&nbsp; &nbsp;

&nbsp; &nbsp; /** Creates new form Calculadora */
&nbsp; &nbsp; public Calculadora() {
&nbsp; &nbsp; &nbsp; &nbsp; initComponents();
&nbsp; &nbsp; }

&nbsp; &nbsp; /** This method is called from within the constructor to
&nbsp; &nbsp; &nbsp;* initialize the form.
&nbsp; &nbsp; &nbsp;* WARNING: Do NOT modify this code. The content of this method is
&nbsp; &nbsp; &nbsp;* always regenerated by the Form Editor.
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; @SuppressWarnings("unchecked")
&nbsp; &nbsp; // &lt;editor-fold defaultstate="collapsed" desc="Generated Code"&gt;//GEN-BEGIN:initComponents
&nbsp; &nbsp; private void initComponents() {

&nbsp; &nbsp; &nbsp; &nbsp; display = new javax.swing.JTextField();
&nbsp; &nbsp; &nbsp; &nbsp; limpar = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; um = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; dois = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; tres = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; quatro = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; cinco = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; seis = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; sete = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; oito = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; nove = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; zero = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; soma = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; subtrai = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; mult = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; divide = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; igual = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; jButton1 = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; raiz = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; seno = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; cosceno = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; tangente = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; fatorial = new javax.swing.JButton();
&nbsp; &nbsp; &nbsp; &nbsp; jMenuBar1 = new javax.swing.JMenuBar();
&nbsp; &nbsp; &nbsp; &nbsp; jMenu1 = new javax.swing.JMenu();
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem1 = new javax.swing.JMenuItem();
&nbsp; &nbsp; &nbsp; &nbsp; jMenu2 = new javax.swing.JMenu();
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem3 = new javax.swing.JMenuItem();
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem4 = new javax.swing.JMenuItem();
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem5 = new javax.swing.JMenuItem();
&nbsp; &nbsp; &nbsp; &nbsp; jMenu3 = new javax.swing.JMenu();
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem2 = new javax.swing.JMenuItem();

&nbsp; &nbsp; &nbsp; &nbsp; setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
&nbsp; &nbsp; &nbsp; &nbsp; setResizable(false);

&nbsp; &nbsp; &nbsp; &nbsp; display.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displayActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; limpar.setText("Limpar");
&nbsp; &nbsp; &nbsp; &nbsp; limpar.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; limparActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; um.setText("1");
&nbsp; &nbsp; &nbsp; &nbsp; um.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; umActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; dois.setText("2");
&nbsp; &nbsp; &nbsp; &nbsp; dois.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; doisActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; tres.setText("3");
&nbsp; &nbsp; &nbsp; &nbsp; tres.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tresActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; quatro.setText("4");
&nbsp; &nbsp; &nbsp; &nbsp; quatro.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; quatroActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; cinco.setText("5");
&nbsp; &nbsp; &nbsp; &nbsp; cinco.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cincoActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; seis.setText("6");
&nbsp; &nbsp; &nbsp; &nbsp; seis.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; seisActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; sete.setText("7");
&nbsp; &nbsp; &nbsp; &nbsp; sete.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; seteActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; oito.setText("8");
&nbsp; &nbsp; &nbsp; &nbsp; oito.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oitoActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; nove.setText("9");
&nbsp; &nbsp; &nbsp; &nbsp; nove.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noveActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; zero.setText("0");
&nbsp; &nbsp; &nbsp; &nbsp; zero.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zeroActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; soma.setText("+");
&nbsp; &nbsp; &nbsp; &nbsp; soma.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; somaActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });
&nbsp; &nbsp; &nbsp; &nbsp; soma.addKeyListener(new java.awt.event.KeyAdapter() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void keyPressed(java.awt.event.KeyEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; somaKeyPressed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; subtrai.setText("-");
&nbsp; &nbsp; &nbsp; &nbsp; subtrai.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subtraiActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; mult.setText("*");
&nbsp; &nbsp; &nbsp; &nbsp; mult.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; multActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; divide.setText("/");
&nbsp; &nbsp; &nbsp; &nbsp; divide.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; divideActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; igual.setText("=");
&nbsp; &nbsp; &nbsp; &nbsp; igual.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; igualActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; jButton1.setText("+/-");
&nbsp; &nbsp; &nbsp; &nbsp; jButton1.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jButton1ActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; raiz.setText("raiz quadrada");
&nbsp; &nbsp; &nbsp; &nbsp; raiz.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; raizActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; seno.setText("seno");
&nbsp; &nbsp; &nbsp; &nbsp; seno.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; senoActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; cosceno.setText("cosceno");
&nbsp; &nbsp; &nbsp; &nbsp; cosceno.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; coscenoActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; tangente.setText("tangente");
&nbsp; &nbsp; &nbsp; &nbsp; tangente.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tangenteActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; fatorial.setText("fatorial");
&nbsp; &nbsp; &nbsp; &nbsp; fatorial.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fatorialActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; jMenu1.setText("File");
&nbsp; &nbsp; &nbsp; &nbsp; jMenu1.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jMenu1ActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem1.setText("Sair");
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jMenuItem1ActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });
&nbsp; &nbsp; &nbsp; &nbsp; jMenu1.add(jMenuItem1);

&nbsp; &nbsp; &nbsp; &nbsp; jMenuBar1.add(jMenu1);

&nbsp; &nbsp; &nbsp; &nbsp; jMenu2.setText("Edit");

&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem3.setText("copy");
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jMenuItem3ActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });
&nbsp; &nbsp; &nbsp; &nbsp; jMenu2.add(jMenuItem3);

&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK));
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem4.setText("cut");
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jMenuItem4ActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });
&nbsp; &nbsp; &nbsp; &nbsp; jMenu2.add(jMenuItem4);

&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem5.setText("paste");
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jMenuItem5ActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });
&nbsp; &nbsp; &nbsp; &nbsp; jMenu2.add(jMenuItem5);

&nbsp; &nbsp; &nbsp; &nbsp; jMenuBar1.add(jMenu2);

&nbsp; &nbsp; &nbsp; &nbsp; jMenu3.setText("about");
&nbsp; &nbsp; &nbsp; &nbsp; jMenu3.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jMenu3ActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });

&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem2.setText("Version");
&nbsp; &nbsp; &nbsp; &nbsp; jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void actionPerformed(java.awt.event.ActionEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jMenuItem2ActionPerformed(evt);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });
&nbsp; &nbsp; &nbsp; &nbsp; jMenu3.add(jMenuItem2);

&nbsp; &nbsp; &nbsp; &nbsp; jMenuBar1.add(jMenu3);

&nbsp; &nbsp; &nbsp; &nbsp; setJMenuBar(jMenuBar1);

&nbsp; &nbsp; &nbsp; &nbsp; javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
&nbsp; &nbsp; &nbsp; &nbsp; getContentPane().setLayout(layout);
&nbsp; &nbsp; &nbsp; &nbsp; layout.setHorizontalGroup(
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(87, 87, 87)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(display, javax.swing.GroupLayout.PREFERRED_SIZE, 296, javax.swing.GroupLayout.PREFERRED_SIZE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(um, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(30, 30, 30)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(dois, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(18, 18, 18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(tres, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(quatro)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(sete)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(jButton1))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(zero)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(18, 18, 18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(igual, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(28, 28, 28)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(oito, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(18, 18, 18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(nove, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(2, 2, 2))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(cinco, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(18, 18, 18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(seis, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(105, 105, 105)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(2, 2, 2)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(mult, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(soma, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(4, 4, 4)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(divide, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(4, 4, 4)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(subtrai, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(40, 40, 40)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(limpar)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(raiz)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(seno)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(cosceno)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(tangente)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(fatorial))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(43, 43, 43))
&nbsp; &nbsp; &nbsp; &nbsp; );

&nbsp; &nbsp; &nbsp; &nbsp; layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cinco, dois, igual, jButton1, nove, oito, quatro, seis, sete, tres, um, zero});

&nbsp; &nbsp; &nbsp; &nbsp; layout.setVerticalGroup(
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(41, 41, 41)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(limpar)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(display, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(24, 24, 24)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(dois)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(soma, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(tres)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(raiz)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(um))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(18, 18, 18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(subtrai, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(quatro)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(cinco)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(seis))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(18, 18, 18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(sete)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(18, 18, 18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(igual)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(jButton1)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(zero)))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(nove)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(mult, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(oito))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(18, 18, 18)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(divide, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(54, 54, 54))
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGroup(layout.createSequentialGroup()
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(9, 9, 9)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(seno)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(cosceno)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(tangente)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addComponent(fatorial)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .addGap(43, 43, 43))))
&nbsp; &nbsp; &nbsp; &nbsp; );

&nbsp; &nbsp; &nbsp; &nbsp; layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {cinco, dois, igual, jButton1, nove, oito, quatro, seis, sete, tres, um, zero});

&nbsp; &nbsp; &nbsp; &nbsp; pack();
&nbsp; &nbsp; }// &lt;/editor-fold&gt;//GEN-END:initComponents

&nbsp; &nbsp;
&nbsp; &nbsp; private void displayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; }//GEN-LAST:event_displayActionPerformed

&nbsp; &nbsp; private void limparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_limparActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; display.setText("0");
&nbsp; &nbsp; &nbsp; &nbsp; setMemoria(0);
&nbsp; &nbsp; &nbsp; &nbsp; setOper(0);
&nbsp; &nbsp; &nbsp; &nbsp; setLimpa(false);
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_limparActionPerformed

&nbsp; &nbsp; private void umActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_umActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("1");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_umActionPerformed

&nbsp; &nbsp; private void doisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_doisActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("2");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_doisActionPerformed

&nbsp; &nbsp; private void tresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tresActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("3");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_tresActionPerformed

&nbsp; &nbsp; private void quatroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_quatroActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("4");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_quatroActionPerformed

&nbsp; &nbsp; private void cincoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cincoActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("5");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_cincoActionPerformed

&nbsp; &nbsp; private void seisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_seisActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("6");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_seisActionPerformed

&nbsp; &nbsp; private void seteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_seteActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("7");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_seteActionPerformed

&nbsp; &nbsp; private void oitoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oitoActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("8");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_oitoActionPerformed

&nbsp; &nbsp; private void noveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noveActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("9");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_noveActionPerformed

&nbsp; &nbsp; private void zeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zeroActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; numero("0");
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_zeroActionPerformed

&nbsp; &nbsp; private void somaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_somaActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // Operação SOMA
&nbsp; &nbsp; &nbsp; &nbsp; operacao(1);
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_somaActionPerformed

&nbsp; &nbsp; private void subtraiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_subtraiActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; operacao(2);
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_subtraiActionPerformed

&nbsp; &nbsp; private void multActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_multActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; operacao(3);
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_multActionPerformed

&nbsp; &nbsp; private void divideActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_divideActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; operacao(4);
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_divideActionPerformed

&nbsp; &nbsp; private void igualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_igualActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; operacao(getOper());
&nbsp; &nbsp; &nbsp; &nbsp; setOper(0);
&nbsp; &nbsp; &nbsp; &nbsp; setLimpa(false);
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
}//GEN-LAST:event_igualActionPerformed

&nbsp; &nbsp; private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; double aux = -1 * Double.parseDouble(display.getText());
&nbsp; &nbsp; &nbsp; &nbsp; display.setText(String.valueOf(aux));
}//GEN-LAST:event_jButton1ActionPerformed

&nbsp; &nbsp; private void raizActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_raizActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; double aux = Math.sqrt(Double.parseDouble(display.getText()));
&nbsp; &nbsp; &nbsp; &nbsp; display.setText(String.valueOf(aux));
&nbsp; &nbsp; }//GEN-LAST:event_raizActionPerformed

&nbsp; &nbsp; private void senoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_senoActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; double aux = Math.sin(Double.parseDouble(display.getText()));
&nbsp; &nbsp; &nbsp; &nbsp; display.setText(String.valueOf(aux));
&nbsp; &nbsp; }//GEN-LAST:event_senoActionPerformed

&nbsp; &nbsp; private void coscenoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_coscenoActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; double aux = Math.cos(Double.parseDouble(display.getText()));
&nbsp; &nbsp; &nbsp; &nbsp; display.setText(String.valueOf(aux));
&nbsp; &nbsp; }//GEN-LAST:event_coscenoActionPerformed

&nbsp; &nbsp; private void tangenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tangenteActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; double aux = Math.tan(Double.parseDouble(display.getText()));
&nbsp; &nbsp; &nbsp; &nbsp; display.setText(String.valueOf(aux));
&nbsp; &nbsp; }//GEN-LAST:event_tangenteActionPerformed

&nbsp; &nbsp; private void fatorialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fatorialActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; double val = Double.parseDouble(display.getText());
&nbsp; &nbsp; &nbsp; &nbsp; int aux = 1;
&nbsp; &nbsp; &nbsp; &nbsp; for(int i=1; i&lt;=val; i++){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aux = aux*i;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; display.setText(Double.toString(aux));
&nbsp; &nbsp; }//GEN-LAST:event_fatorialActionPerformed

&nbsp; &nbsp; private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu1ActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; }//GEN-LAST:event_jMenu1ActionPerformed

&nbsp; &nbsp; private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; System.exit(WIDTH);
&nbsp; &nbsp; }//GEN-LAST:event_jMenuItem1ActionPerformed

&nbsp; &nbsp; private void jMenu3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu3ActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; }//GEN-LAST:event_jMenu3ActionPerformed

&nbsp; &nbsp; private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here: &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp;Sobre ap = new Sobre (this, true);
&nbsp; &nbsp; &nbsp; &nbsp;ap.setVisible(rootPaneCheckingEnabled);
&nbsp; &nbsp; }//GEN-LAST:event_jMenuItem2ActionPerformed

&nbsp; &nbsp; private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; display.selectAll();
&nbsp; &nbsp; &nbsp; &nbsp; display.copy();
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_jMenuItem3ActionPerformed

&nbsp; &nbsp; private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; display.selectAll();
&nbsp; &nbsp; &nbsp; &nbsp; display.cut();
&nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; }//GEN-LAST:event_jMenuItem4ActionPerformed

&nbsp; &nbsp; private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; display.paste();
&nbsp; &nbsp; }//GEN-LAST:event_jMenuItem5ActionPerformed

&nbsp; &nbsp; private void somaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_somaKeyPressed
&nbsp; &nbsp; &nbsp; &nbsp; // TODO add your handling code here:
&nbsp; &nbsp; &nbsp; &nbsp; if (evt.getKeyCode() == evt.VK_PLUS){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; operacao(1);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display.requestFocus();
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; }//GEN-LAST:event_somaKeyPressed

&nbsp; &nbsp; /**
&nbsp; &nbsp; &nbsp;* @param args the command line arguments
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; public static void main(String args[]) {
&nbsp; &nbsp; &nbsp; &nbsp; java.awt.EventQueue.invokeLater(new Runnable() {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void run() {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new Calculadora().setVisible(true);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; });
&nbsp; &nbsp; }
&nbsp; &nbsp; // Variables declaration - do not modify//GEN-BEGIN:variables
&nbsp; &nbsp; private javax.swing.JButton cinco;
&nbsp; &nbsp; private javax.swing.JButton cosceno;
&nbsp; &nbsp; private javax.swing.JTextField display;
&nbsp; &nbsp; private javax.swing.JButton divide;
&nbsp; &nbsp; private javax.swing.JButton dois;
&nbsp; &nbsp; private javax.swing.JButton fatorial;
&nbsp; &nbsp; private javax.swing.JButton igual;
&nbsp; &nbsp; private javax.swing.JButton jButton1;
&nbsp; &nbsp; private javax.swing.JMenu jMenu1;
&nbsp; &nbsp; private javax.swing.JMenu jMenu2;
&nbsp; &nbsp; private javax.swing.JMenu jMenu3;
&nbsp; &nbsp; private javax.swing.JMenuBar jMenuBar1;
&nbsp; &nbsp; private javax.swing.JMenuItem jMenuItem1;
&nbsp; &nbsp; private javax.swing.JMenuItem jMenuItem2;
&nbsp; &nbsp; private javax.swing.JMenuItem jMenuItem3;
&nbsp; &nbsp; private javax.swing.JMenuItem jMenuItem4;
&nbsp; &nbsp; private javax.swing.JMenuItem jMenuItem5;
&nbsp; &nbsp; private javax.swing.JButton limpar;
&nbsp; &nbsp; private javax.swing.JButton mult;
&nbsp; &nbsp; private javax.swing.JButton nove;
&nbsp; &nbsp; private javax.swing.JButton oito;
&nbsp; &nbsp; private javax.swing.JButton quatro;
&nbsp; &nbsp; private javax.swing.JButton raiz;
&nbsp; &nbsp; private javax.swing.JButton seis;
&nbsp; &nbsp; private javax.swing.JButton seno;
&nbsp; &nbsp; private javax.swing.JButton sete;
&nbsp; &nbsp; private javax.swing.JButton soma;
&nbsp; &nbsp; private javax.swing.JButton subtrai;
&nbsp; &nbsp; private javax.swing.JButton tangente;
&nbsp; &nbsp; private javax.swing.JButton tres;
&nbsp; &nbsp; private javax.swing.JButton um;
&nbsp; &nbsp; private javax.swing.JButton zero;
&nbsp; &nbsp; // End of variables declaration//GEN-END:variables

&nbsp; &nbsp; // FUNÇÃO PARA JOGAR NUMERO NA TELA
&nbsp; &nbsp; public void numero(String num){
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; if(getOper() &gt; 0){ // verifica se tem alguma operação pendente
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ("".equals(display.getText())){ // verifica se o display esta vazio
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setTela(display.getText()); // joga o conteudo da tela para a variavel publica "tela"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display.setText(getTela() + num); // pega o conteudo da variavel "tela" e concatena com o numero
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setOper(0);// zera a operação pendente
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setLimpa(false);// variavel limpa mostrra se a tela esta vazia (1) ou não (0)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }else{ // se o display não esta vazio
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (getLimpa() == false){ &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display.setText(""); // limpa o display
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setLimpa(true);}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setTela(display.getText()); // joga o conteudo da tela para a variavel publica "tela"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display.setText(getTela() + num); // pega o conteudo da variavel "tela" e concatena com o numero
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //setOper(0);// zera a operação pendente
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; }else{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (getLimpa() == false){ &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display.setText(""); // limpa o display
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setLimpa(true);}
&nbsp; &nbsp; &nbsp; &nbsp; setTela(display.getText()); // joga o conteudo da tela para a variavel publica "tela"
&nbsp; &nbsp; &nbsp; &nbsp; display.setText(getTela() + num);}
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; }
&nbsp; &nbsp;
&nbsp; &nbsp; // FUNÇÃO PPARA CHAMAR UMA OPERAÇÃO
&nbsp; &nbsp; public void operacao(int op){
&nbsp; &nbsp; try{
&nbsp; &nbsp; &nbsp; &nbsp; double aux = Double.parseDouble(display.getText());// variavel "aux" recebe o conteudo do display (convertido)
&nbsp; &nbsp; &nbsp; &nbsp; aux = executa(getOper(), aux); // variavel "aux" recebe o resultado da operação "op"
&nbsp; &nbsp; &nbsp; &nbsp; setMemoria(aux);// resultado da operação vai para a variavel publica "memoria"
&nbsp; &nbsp; &nbsp; &nbsp; aux = getMemoria();// aux recebe o valor da variavel memoria
&nbsp; &nbsp; &nbsp; &nbsp; display.setText(String.valueOf(aux)); // o valor de "aux" é convertido pra string e mostrado no display
&nbsp; &nbsp; &nbsp; &nbsp; setOper(op);// a operação pendente passa a ser novamente "op"
&nbsp; &nbsp; &nbsp; &nbsp; setLimpa(false);
&nbsp; &nbsp; &nbsp; &nbsp; }catch(Exception e){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JOptionPane.showMessageDialog(null, "Alguma coisa saiu errado!");
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; }
&nbsp; &nbsp;
&nbsp; &nbsp; // FUUNÇÃO PARA EXECUTAR UMA OPERAÇÃO
&nbsp; &nbsp; public double executa(int oper, double valor){
&nbsp; &nbsp; &nbsp; &nbsp; double aux = getMemoria();
&nbsp; &nbsp; &nbsp; &nbsp; if (oper == 1){
&nbsp; &nbsp; &nbsp; &nbsp; valor = aux + valor; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; else if(oper == 2) {
&nbsp; &nbsp; &nbsp; &nbsp; if (aux == 0){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; valor = valor - aux;
&nbsp; &nbsp; &nbsp; &nbsp; }else{
&nbsp; &nbsp; &nbsp; &nbsp; valor = aux - valor;}
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; else if(oper == 3) {
&nbsp; &nbsp; &nbsp; &nbsp; valor = aux * valor;
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; else if(oper == 4) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try{
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;valor = aux / valor;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}catch(Exception e){
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JOptionPane.showMessageDialog(null, "Divisão inválida!");
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; return valor;
&nbsp; &nbsp; }
&nbsp; &nbsp;
&nbsp; &nbsp; /**
&nbsp; &nbsp; &nbsp;* @return the memoria
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; public double getMemoria() {
&nbsp; &nbsp; &nbsp; &nbsp; return memoria;
&nbsp; &nbsp; }

&nbsp; &nbsp; /**
&nbsp; &nbsp; &nbsp;* @param memoria the memoria to set
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; public void setMemoria(double memoria) {
&nbsp; &nbsp; &nbsp; &nbsp; this.memoria = memoria;
&nbsp; &nbsp; }

&nbsp; &nbsp; /**
&nbsp; &nbsp; &nbsp;* @return the tela
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; public String getTela() {
&nbsp; &nbsp; &nbsp; &nbsp; return tela;
&nbsp; &nbsp; }

&nbsp; &nbsp; /**
&nbsp; &nbsp; &nbsp;* @param tela the tela to set
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; public void setTela(String tela) {
&nbsp; &nbsp; &nbsp; &nbsp; this.tela = tela;
&nbsp; &nbsp; }

&nbsp; &nbsp; /**
&nbsp; &nbsp; &nbsp;* @return the oper
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; public int getOper() {
&nbsp; &nbsp; &nbsp; &nbsp; return oper;
&nbsp; &nbsp; }

&nbsp; &nbsp; /**
&nbsp; &nbsp; &nbsp;* @param oper the oper to set
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; public void setOper(int oper) {
&nbsp; &nbsp; &nbsp; &nbsp; this.oper = oper;
&nbsp; &nbsp; }

&nbsp; &nbsp; /**
&nbsp; &nbsp; &nbsp;* @return the limpa
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; public boolean getLimpa() {
&nbsp; &nbsp; &nbsp; &nbsp; return limpa;
&nbsp; &nbsp; }

&nbsp; &nbsp; /**
&nbsp; &nbsp; &nbsp;* @param limpa the limpa to set
&nbsp; &nbsp; &nbsp;*/
&nbsp; &nbsp; public void setLimpa(boolean limpa) {
&nbsp; &nbsp; &nbsp; &nbsp; this.limpa = limpa;
&nbsp; &nbsp; }
}