0% found this document useful (0 votes)
3 views

Practical 1

The document contains Java code for creating GUI applications using AWT, specifically defining a Frame with checkboxes, text fields, and buttons. It includes two practical examples of a class named 'test' that sets up a simple user interface with language options and gender selection. Additionally, there are references to practical outputs for other sections, but no specific details are provided for them.

Uploaded by

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

Practical 1

The document contains Java code for creating GUI applications using AWT, specifically defining a Frame with checkboxes, text fields, and buttons. It includes two practical examples of a class named 'test' that sets up a simple user interface with language options and gender selection. Additionally, there are references to practical outputs for other sections, but no specific details are provided for them.

Uploaded by

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

Practical 1:

1.

import java.awt.*;

class test extends Frame{

Checkbox c1,c2, r1, r2;

CheckboxGroup cgb;

test(){

setVisible(true);

setSize(400, 400);

setTitle("MYframe");

setLayout(new FlowLayout());

c1 = new Checkbox("English", false);

c2= new Checkbox("Marathi", false);

c1.setBounds(100,100,50,50);

add(c1);

c2.setBounds(150,150,50,50);

add(c2);

cgb = new CheckboxGroup();

r1 = new Checkbox("male" , false,cgb);

r2 = new Checkbox("female" , false , cgb);

add(r1);

add(r2); }

public static void main(String args[]) {

test t = new test();

}}
2.

import java.awt.*;

class test extends Frame {

Checkbox c1, c2, r1, r2;

CheckboxGroup cgb;

test() {

setVisible(true);

setSize(400, 400);

setTitle("My Frame");

setLayout(new FlowLayout());

c1 = new Checkbox("English", false);

c2 = new Checkbox("Marathi", false);

TextArea ta = new TextArea("Yes", 5, 30);

TextField tf = new TextField(30);

Button b2 = new Button("Submit");

Label l1 = new Label("Name");

add(l1);

add(tf);

add(c1);

add(c2);

cgb = new CheckboxGroup();

r1 = new Checkbox("Male", false, cgb);

r2 = new Checkbox("Female", false, cgb);

add(r1);

add(r2);

add(ta);

add(b2);

public static void main(String args[]) {

test t = new test();

}}
Practical 3

X. Output

Q1

Q2
Practical 4

X .Q output
Practical 5

Q X.Output

You might also like