0% found this document useful (0 votes)
61 views2 pages

Wage - Calculator Coding For Class 12 Ip

This code defines two event handler methods - one to calculate and display a total amount when a "Calculate" button is clicked, and another to clear all fields when a "Clear" button is clicked. The calculate method sets a base amount, adjusts it based on gender and skills selections, multiplies it by the number of days, and displays the total. The clear method resets all text fields and selection boxes.

Uploaded by

Sanjeet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views2 pages

Wage - Calculator Coding For Class 12 Ip

This code defines two event handler methods - one to calculate and display a total amount when a "Calculate" button is clicked, and another to clear all fields when a "Clear" button is clicked. The calculate method sets a base amount, adjusts it based on gender and skills selections, multiplies it by the number of days, and displays the total. The clear method resets all text fields and selection boxes.

Uploaded by

Sanjeet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

private void

calBTNActionPerformed(java.awt.event.ActionEvent
evt) {
double
amt=130,noofdays=Double.parseDouble(noofdaysTF.ge
tText());
if(maleRB.isSelected())
amt=150;
if(skilledCB.isSelected())
amt+=50;
amtTF.setText("Rs. "+(amt*noofdays));
}
private void
clearBTNActionPerformed(java.awt.event.ActionEvent
evt) {
nameTF.setText(null);
noofdaysTF.setText(null);
amtTF.setText(null);
maleRB.setSelected(true);
skilledCB.setSelected(false);
}
Output

You might also like