Monday, February 15, 2016

Program to add RadioButton in Frame.

import java.awt.*;

class RadioButton extends Frame
{
public static void main(String args[ ] )
{
CheckboxGroup og=new CheckboxGroup();
Checkbox male=new Checkbox("Male",og,true);
Checkbox female=new Checkbox("Female",og,false);
RadioButton f1 =new RadioButton();
f1.setTitle("Adding a RadioButton in a Frame!!!");
f1.setLayout(new FlowLayout());
f1.add(male);
f1.add(female);
f1.setSize(500,300);
f1.setVisible(true);

}
}
Output:

No comments:

Post a Comment