DISCOUNT CALCULATOR
GUI
CODES ...
On the click of
calculate
double disc=0;
int code =Integer.parseInt(jTextField1.getText());
double samt =Double.parseDouble(jTextField2.getText());
if(jRadioButton3.isSelected())
disc=samt*0.10;
if(jRadioButton4.isSelected())
disc=samt*0.15;
if (jRadioButton1.isSelected())
disc=samt*0.25;
jTextField3.setText(" "+disc);
double namt=samt-disc;
jTextField4.setText(" "+namt);
on the click of clear
jTextField1.setText(null
);
jTextField2.setText(null
);
jTextField3.setText(null);
jTextField4.setText(null);
ON
THE CLICK OF EXIT
System.exit(0);
OUTPUT ...
No comments:
Post a Comment