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
What do you mean by data type?
Name few java.lang classes introduced with java 8 ?
Difference between character constant and string constant in java ?
How many unicode characters are there?
why doesn't java run on all platforms?
Can singleton class be inherited in java?
Define how objects are stored in java?
What is finalize() function in java?
Tell me the latest versions in java related areas?
Is upper case in java?
what is comparable and comparator interface?
Can It is possible to synchronize the constructor of a Java Class?
Is java platform independent?
Which collection is sorted in java?
What are the legal operands of the instanceof operator?