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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can memory leak in java?

576


What is the purpose of an interface?

548


What do you mean by pointer value and address?

571


What is the primitive type byte?

569


Can we have two methods in a class with the same name?

576






Explain about the dynamic behavior of core java?

628


What is the difference between the paint() and repaint() methods in java programming?

614


What do you mean by global variable?

520


What is the purpose of javac exe?

555


What does flag mean in java?

535


What is the role of the java.rmi.naming class?

515


Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.

1600


Why main method is static in java?

588


What is an object class?

551


What is an interoperable application in java ?

579