Page 84 - IP
P. 84

Q1. Design a maths calculator - addition, subtraction, division and

               multiplication.
































               code for "+" button :


               private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


                Double a,b,Result


               a=Double.parseDouble(jTextField1.getText());
               b=Double.parseDouble(jTextField2.getText());

               Result=a+b;


                jTextField3.setText(Double.toString(Result));

               }
   79   80   81   82   83   84   85   86   87   88   89