add your handling code here: numero("8"); display.requestFocus(); }//GEN-LAST:event_oitoActionPerformed private void noveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noveActionPerformed // TODO add your handling code here: numero("9"); display.requestFocus(); }//GEN-LAST:event_noveActionPerformed private void zeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zeroActionPerformed // TODO add your handling code here: numero("0"); display.requestFocus(); }//GEN-LAST:event_zeroActionPerformed private void somaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_somaActionPerformed // Operacao SOMA operacao(1); display.requestFocus(); }//GEN-LAST:event_somaActionPerformed private void subtraiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_subtraiActionPerformed // TODO add your handling code here: operacao(2); display.requestFocus(); }//GEN-LAST:event_subtraiActionPerformed private void multActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_multActionPerformed // TODO add your handling code here: operacao(3); display.requestFocus(); }//GEN-LAST:event_multActionPerformed private void divideActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_divideActionPerformed // TODO add your handling code here: operacao(4); display.requestFocus(); }//GEN-LAST:event_divideActionPerformed private void igualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_igualActionPerformed // TODO add your handling code here: operacao(getOper()); setOper(0); setLimpa(false); display.requestFocus();}//GEN-LAST:event_igualActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: double aux = -1 * Double.parseDouble(display.getText()); display.setText(String.valueOf(aux));}//GEN-LAST:event_jButton1ActionPerformed private void raizActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_raizActionPerformed // TODO add your handling code here: double aux = Math.sqrt(Double.parseDouble(display.getText())); display.setText(String.valueOf(aux)); }//GEN-LAST:event_raizActionPerformed private void senoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_senoActionPerformed // TODO add your handling code here: double aux = Math.sin(Double.parseDouble(display.getText())); display.setText(String.valueOf(aux)); }//GEN-LAST:event_senoActionPerformed private void coscenoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_coscenoActionPerformed // TODO add your handling code here: double aux = Math.cos(Double.parseDouble(display.getText())); display.setText(String.valueOf(aux)); }//GEN-LAST:event_coscenoActionPerformed private void tangenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tangenteActionPerformed // TODO add your handling code here: double aux = Math.tan(Double.parseDouble(display.getText())); display.setText(String.valueOf(aux)); }//GEN-LAST:event_tangenteActionPerformed private void fatorialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fatorialActionPerformed // TODO add your handling code here: double val = Double.parseDouble(display.getText()); int aux = 1; for(int i=1; i<=val; i++){ aux = aux*i; } display.setText(Double.toString(aux)); }//GEN-LAST:event_fatorialActionPerformed private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jMenu1ActionPerformed private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed // TODO add your handling code here: System.exit(WIDTH); }//GEN-LAST:event_jMenuItem1ActionPerformed private void jMenu3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu3ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jMenu3ActionPerformed private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed // TODO add your handling code here: Sobre ap = new Sobre (this, true); ap.setVisible(rootPaneCheckingEnabled); }//GEN-LAST:event_jMenuItem2ActionPerformed private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed // TODO add your handling code here: display.selectAll(); display.copy(); display.requestFocus(); }//GEN-LAST:event_jMenuItem3ActionPerformed private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed // TODO add your handling code here: display.selectAll(); display.cut(); display.requestFocus(); }//GEN-LAST:event_jMenuItem4ActionPerformed private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed // TODO add your handling code here: display.paste(); }//GEN-LAST:event_jMenuItem5ActionPerformed private void somaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_somaKeyPressed // TODO add your handling code here: if (evt.getKeyCode() == evt.VK_PLUS){ operacao(1); display.requestFocus(); } }//GEN-LAST:event_somaKeyPressed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Calculadora().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton cinco; private javax.swing.JButton cosceno; private javax.swing.JTextField display; private javax.swing.JButton divide; private javax.swing.JButton dois; private javax.swing.JButton fatorial; private javax.swing.JButton igual; private javax.swing.JButton jButton1; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenu jMenu3; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JMenuItem jMenuItem5; private javax.swing.JButton limpar; private javax.swing.JButton mult; private javax.swing.JButton nove; private javax.swing.JButton oito; private javax.swing.JButton quatro; private javax.swing.JButton raiz; private javax.swing.JButton seis; private javax.swing.JButton seno; private javax.swing.JButton sete; private javax.swing.JButton soma; private javax.swing.JButton subtrai; private javax.swing.JButton tangente; private javax.swing.JButton tres; private javax.swing.JButton um; private javax.swing.JButton zero; // End of variables declaration//GEN-END:variables // FUNCAO PARA JOGAR NUMERO NA TELA public void numero(String num){ if(getOper() > 0){ // verifica se tem alguma