We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
import java.applet.*;
import java.awt.*;
public class radio extends Applet {
CheckboxGroup cbg;
public void init() {
add(new Label("Payment mode?"));
cbg = new CheckboxGroup();
add(new Checkbox("Visa", cbg, false));
add(new Checkbox("Mastercard", cbg, false));
add(new Checkbox("American Express", cbg, false));
add(new Checkbox("Cash", cbg, true));
add(new Button("clear radio"));
}
public boolean action(Event e, Object o) {
if (o.equals("clear radio")){
Checkbox current = cbg.getCurrent();
cbg.setCurrent( null );
current.setState( false );
return true;
}
return false;
}
}