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 |
How to extract HashMap values?
why java does compile time polymorphism at run time ?
What is integer valueof?
what is the main class of all the classes
How arrays are stored in memory in java?
what is object slice?
Difference between static synchronization vs. Instance synchronization?
Name few java util classes introduced with java 8 ?
Why do we use threads in java?
Is it possible to write a regular expression to check if string is a number?
List primitive java types?
what are the methods in object?