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 number data type in java?

0 Answers  


What are the drawbacks for singleton class?

0 Answers  


What is class forname used for?

0 Answers  


how can i cal servlet from jsp page?how can i pass variablesfrom the jsp that servlet can access?

1 Answers   Verizon,


What are the drawbacks of singleton class?

0 Answers  






What is class array in java?

0 Answers  


how to transactions(Bank transactions) in business process in ejb?

1 Answers   Photon,


What about features of local inner class?

0 Answers  


Difference between a Scrollbar and a ScrollPane?

1 Answers  


How do you reverse a list?

0 Answers  


What is a substitution variable?

0 Answers  


What is default exception handling in java?

0 Answers  


Categories