Saturday, February 13, 2016

Program to add checkbox in Frame.

import java.awt.*;
class chkBox extends Frame
{
public static void main(String args[ ] )
{
Checkbox c1 =new Checkbox("Reading");
Checkbox c2=new Checkbox("Singing");
Checkbox c3=new Checkbox("Dancing");
c1.setState(true);
chkBox f1=new chkBox();
f1.setTitle("Adding a Checkbox in a Frame!!!");
f1.setLayout(new FlowLayout());
f1.add(c1);
f1.add(c2);
f1.add(c3);
f1.setSize(500,300);
f1.setVisible(true);
}
}
Output:

No comments:

Post a Comment