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 are the uses of synchronized keyword?
What is an example of declaration?
What is Enum in Java?
How to perform linear search in java?
Explain the meaning of java applet.
What are the legal operands of the instanceof operator?
What is ascii code?
What is the differences between c++ and java? Explain
Explain the public class modifier?
What is set and get methods in java?
Is it possible to use Semaphore/ Mutex in an Interrupt Handler?
Write a program to print fibonacci series
What is meant by 'Class access modifiers'?
Can a set contain duplicates?
Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?