+ 6
How to create a calculator in netbean
6 Réponses
+ 24
Use your java skills ;)
Try to find different examples. There are plenty of them on the Internet.
+ 5
no
+ 5
sorryyyyyy yes I am using
+ 4
Ok, first drag and drop all the components including 3 Text fields + All buttons for add subt etc + Labels
Then code on each button by double clicking on it.
example for add button write:-
double a= Double.parseDouble(tf1.getText());
double b= Double.parseDouble(tf2.getText());
tf3.setText(a+b);
NOTE:- tf1 is the name of The first input text field
tf2 is.........second text field
tf3 is......... output textfield
you can change these by right clicking a button and selecting change varaible name (2nd option)
+ 1
Using switch cases for mathematical operators
0
Are you using GUI builder ?