0% found this document useful (0 votes)
11 views1 page

PracticalNo1 2

AJP Practical 1 Code 2

Uploaded by

xamexi1077
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

PracticalNo1 2

AJP Practical 1 Code 2

Uploaded by

xamexi1077
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Practical No.

: 01

Practical Name: Write a program to demonstrate the use of AWT components.

Roll No.: 47

Student Name: Mavani Ashish Shantilal

Program:
import java.awt.*;
class practical1_2
{
public static void main(String args[])
{
Frame f = new Frame("Checkbox & RadioButton");
f.setVisible(true);
f.setSize(400,500);
f.setLayout(new FlowLayout());

Label l1 = new Label("Select Language");


Checkbox c1 = new Checkbox("English");
Checkbox c2 = new Checkbox("Hindi");
Checkbox c3 = new Checkbox("Marathi");
Checkbox c4 = new Checkbox("Sanskrit");
Label l2 = new Label("Select Gender");
CheckboxGroup cbg = new CheckboxGroup();
Checkbox c5 = new Checkbox("Male", cbg, false);
Checkbox c6 = new Checkbox("Female", cbg, false);

f.add(l1);
f.add(c1);
f.add(c2);
f.add(c3);
f.add(c4);
f.add(l2);
f.add(c5);
f.add(c6);
}
}

Output:

You might also like