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 are the default and parameterized constructors?

0 Answers  


how to print hello world every second till i have pressed enter key ???

1 Answers   SAP Labs,


How does multithreading take place on a computer with a single cpu?

0 Answers  


How is string immutable in java?

0 Answers  


Can try statements be nested?

3 Answers   Wipro,


What are the wrapped, classes?

0 Answers  


What is the argument in java?

0 Answers  


Why java is considered dynamic?

0 Answers  


what is Abstract DataType?

1 Answers  


WHAT IS THE MEANING OF ALL TYPE OF BUZZWORDS?

4 Answers  


What is null statement?

0 Answers  


what is the use of abstract class?

3 Answers   Amdocs, Atos Origin, Invictus,


Categories