You are on page 1of 4

Name of Student: Ekambe Ganesh Roll No.

: 53
Experiment No.: 01 DOS:

*Exercise

1. Develop a program using Label to display message “Welcome to Java”


Code:

import java.awt.*;

public class label5


{
public static void main(String args[])
{
Frame fr=new Frame("This Program is for Displaying the Label");
fr.setSize(400,200);
fr.setLayout(new FlowLayout());
fr.setVisible(true);
Label Lb =new Label(" Welcome to Java");
fr.add(Lb);

}
}

Output
Name of Student: Ekambe Ganesh Roll No.: 53
Experiment No.: 01 DOS:

2. Develop a program to select multiple languages known to user. (e. g


Marathi, Hindi, English, Sanskrit)

Code:

import java.awt.*;
class Subject_chk
{
public static void main(String[] args)
{
int i;
Frame fr=new Frame("select multiple languages ");
fr.setSize(350,300);
fr.setLayout(new FlowLayout());
fr.setVisible(true);
Checkbox box1=new Checkbox("Marathi");
Checkbox box2=new Checkbox("Hindi");
Checkbox box3=new Checkbox("English");
Checkbox box4=new Checkbox("Sanskrit");

fr.add(box1);
fr.add(box2);
fr.add(box3);
fr.add(box4);
}
}

Output
Name of Student: Ekambe Ganesh Roll No.: 53
Experiment No.: 01 DOS:

3. Write a program to create three Buttons with Caption OK, RESET and
CANCEL.

import java.awt.*;

public class Butto1_demo {

public static void main(String args[])


{
Frame fr=new Frame("This Program is for Displaying the Button");
fr.setSize(400,200);
fr.setLayout(new FlowLayout());
fr.setVisible(true);
Button B1=new Button("Ok");
Button B2=new Button("RESET");
Button B3=new Button("CANCEL");

fr.add(B1);
fr.add(B2);
fr.add(B3);
}
}

Output
Name of Student: Ekambe Ganesh Roll No.: 53
Experiment No.: 01 DOS:

You might also like