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
List the features of java programming language.
What does java stand for?
How do you find the absolute value?
Say you want to store the information about a number of pets in an array. Typical information that you could store for each pet (where relevant) would be • Breed of animal • Animal's name • Its birth date • Its sex • Whether it has been sterilised or not • When it is due for its next inoculation • When it last had its wings clipped For each type of pet (eg. dog, cat or bird) you would typically define a class to hold the relevant data. Note: You do not need to implement these classes. Just answer the following questions. 3.1.1 What would be the advantage of creating a superclass (eg. Pet) and declaring an array of Pet objects over simply using an array of Objects, storing each of the instances of the different pet classes (eg. Dog, Cat or Bird) in it? 3.1.2 Would you define Pet as a class or as an interface? Why? (2) (2)
What is package protected in java?
Explain scope or life time of local variables in java?
What do you mean Abstraction in java?
Which is easier netbeans or eclipse?
What is a local, member and a class variable?
What is difference between public static and void?
What is private protected in java?
How do you use compareto method?
Is null in java?
how to open and edit XML file in Weblogic???
Is an array a vector?