Net beansprojects
-
Upload
pratik8897 -
Category
Education
-
view
304 -
download
1
description
Transcript of Net beansprojects
Coding
• Double click the exit button and type the following code as it is: System.exit(0);
• Then double click the clear button and type the following code in it:
• jTextField1.setText("");• jTextField2.setText("");• jTextField3.setText("");
Coding
• Double click the add button and type the following coding in it:
• Float num1, num2, result;• num1= Float.parseFloat(jTextField1.getText());• num2= Float.parseFloat(jTextField2.getText());• result= num1 + num2;• jTextField3.setText(String.valueOf(result));
• Double click the subtract button and type the following coding in it:
• Float num1, num2, result;• num1= Float.parseFloat(jTextField1.getText());• num2= Float.parseFloat(jTextField2.getText());• result= num1 - num2;• jTextField3.setText(String.valueOf(result));
• Double click the multiply button and type the following coding in it:
• Float num1, num2, result;• num1= Float.parseFloat(jTextField1.getText());• num2= Float.parseFloat(jTextField2.getText());• result= num1 * num2;• jTextField3.setText(String.valueOf(result));
• Double click the divide button and type the following coding in it:
• Float num1, num2, result;• num1= Float.parseFloat(jTextField1.getText());• num2= Float.parseFloat(jTextField2.getText());• result= num1 / num2;• jTextField3.setText(String.valueOf(result));
ALL THE BEST EVERYONE