1.

Write code for the Item event handler of a checkbox (namely incCB) that increments a variable total and displays it on a label (namely count) if the checkbox is selected.

Answer»

private void j Check Box 1 Action Performed (java. awt .event. Action Event evt) 

{

int total=5;

if(j Check Box 1.is Selected()==true) 

{

total=total+1; 

j Label 4.set Text(Integer. to String(total));

else 

{

j Label 4.set Text (Integer. to String(total));

}



Discussion

No Comment Found

Related InterviewSolutions