What method is used to know the status of Checkbox(i.e it
is checked or unchecked)?



What method is used to know the status of Checkbox(i.e it is checked or unchecked)?..

Answer / latha

Hi guys, while posting questions in forum make sure that
the question that has been posted by you has clarity or not.

For this question two possible answers are there, they
belogs to

1. AWT controls
2. Java script

Both are having different methods to know the selected
check box value.

Coming to AWT controls, the solution is..

ItemEventobject.getStateChange()==ITEMEVENT.SELECTED

is the syntax to know the selected check box.

Eg::

public void itemStateChanged(ItemEvent ie)
{

double price = out.getPrice();
if (ie.getStateChange() == ItemEvent.SELECTED)
price += 0.50;
else price -= 0.50;

}

In javascript it is so easy to select the checked check box
value by using "checked" property.

Regards
Latha

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is string substring?

0 Answers  


Write a function to print Fibonacci series and Tribonacci series?

0 Answers   Hexaware,


What are uses of Hash Code?

2 Answers   Cognizant,


What is a protected class in java?

0 Answers  


What is the difference between the direct buffer and non-direct buffer in java?

0 Answers  






What is a void method java?

0 Answers  


What is role of void keyword in declaring functions?

0 Answers   Adobe,


how can we use the servlet as standalone apllication?should we need to extend any class?

2 Answers   Logica CMG,


int a=1,b=10; System.out.println(a+b--);

12 Answers   HCL,


What is unicode?

1 Answers  


Why java is not 100% object-oriented?

1 Answers  


What is a stringbuilder?

0 Answers  


Categories