Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ("PRODOTTO".equals(e.getActionCommand())){ // se è stato premuto il tasto converti
- try {
- num1= Double.parseDouble(Numero1.getText());
- num2= Double.parseDouble(Numero2.getText());
- ris = num1*num2;
- Risultato.setText(""+ris);
- }
- catch (Exception exc){
- //tEuro.setText("");
- }
- }
- if ("QUOZIENTE".equals(e.getActionCommand())){ // se è stato premuto il tasto converti
- try {
- num1= Double.parseDouble(Numero1.getText());
- num2= Double.parseDouble(Numero2.getText());
- ris = num1/num2;
- Risultato.setText(""+ris);
- }
- catch (Exception exc){
- //tEuro.setText("");
- }
- }
- if ("MODULO".equals(e.getActionCommand())){ // se è stato premuto il tasto converti
- try {
- num1= Double.parseDouble(Numero1.getText());
- num2= Double.parseDouble(Numero2.getText());
- ris = num1%num2;
- Risultato.setText(""+ris);
- }
- catch (Exception exc){
- //tEuro.setText("");
- }
- }
- if ("RESET".equals(e.getActionCommand())){ // se è stato premuto il tasto converti
- try {
- Numero1.setText("");
- Numero2.setText("");
- num1=Double.parseDouble(Numero1.getText());
- num2=Double.parseDouble(Numero2.getText());
- ris=0;
- Risultato.setText(""+ris);
- }
- catch (Exception exc){
- //tEuro.setText("");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement