Checkboxes:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
/*<applet code="CheckBoxDemo" width=300 height=300></applet>*/
public class CheckBoxDemo extends Applet implements ItemListener
{
Label l1;
public void init()
{
Checkbox c1=new Checkbox("B.C.A.");
c1.addItemListener(this);
add(c1);
Checkbox c2=new Checkbox("B.B.A.");
c2.addItemListener(this);
add(c2);
Checkbox c3=new Checkbox("B.Com.");
c3.addItemListener(this);
add(c3);
l1=new Label(" ");
add(l1);
}
public void itemStateChanged(ItemEvent ie)
{
Checkbox cb=(Checkbox)ie.getItemSelectable();
l1.setText(cb.getLabel());
}
}
Heyyyyy this is Paras Manavdariya And your watching my blog here you read New JAVA related articles and much more like songs, Free software, hacking PDFs So Thank you for watching my blog I'm done my 1000+ views Please share and subscribe
Comments
Post a Comment