Checkbox

A checkbox is again a label which is displayed
as a pushbutton as shown in the example below. This pushbutton can either
be checked or unchecked. Therefore, the state of the checkbox is
either true or false. However, the initial state is false which is
the default one. The example below shows the checkbox whose state gets toggled
<<<<<<< checkbox.shtml
on clicking.
=======
on clicking.
>>>>>>> 1.2
import java.awt.*;
import java.applet.Applet;
public class MyCheckbox extends Applet {
public void init() {
Checkbox c = new Checkbox("Choose this option");
add(c);
}
}
|
|
Here is the Output:
C:\newprgrm>javac MyCheckbox.java
C:\newprgrm>appletviewer MyCheckbox.html |

Download
this example.

|
Current Comments
3 comments so far (post your own) View All Comments Latest 10 Comments:awt package,util package,not working package.lang package,io package
Posted by rajaprabu on Tuesday, 02.5.08 @ 15:35pm | #47288
awt package,util package,not working package.lang package,io package
Posted by rajaprabu on Tuesday, 02.5.08 @ 15:34pm | #47287
send to my e_mail
Posted by amal on Monday, 11.12.07 @ 10:24am | #36941