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

Difference between class#getinstance() and new operator ?

0 Answers  


What is the difference between compiler and jvm?

0 Answers  


how to handle http request in struts

2 Answers   Polaris,


how do you store phone numbers using java collections

5 Answers   Bosch, IBAB,


what is platform

2 Answers   i3 Solutions,






What is slash r?

0 Answers  


What is the latest java version?

0 Answers  


Can you make a constructor final in Java?

0 Answers   SwanSoft Technologies,


What for read() function?

3 Answers  


What is the purpose of the system class in java?

0 Answers  


what are the major differences between jdk1.4 and jdk1.5?

2 Answers   Cap Gemini, Crimson Logic, Infosys, TCS, Tenth Planet,


What does flagged out mean?

0 Answers  


Categories