Sports Java Project Converted JAVA 1234
Sports Java Project Converted JAVA 1234
FRESHMAN ENGINEERING
DEPARTMENT
A Project Based Lab Report
On
SUBMITTED BY:
2200032182 Y Sriram
DR. ASHISH
ASST.PROFESSOR
KL UNIVERSITY
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CERTIFICATE
1 INTRODUCTION 6
4 CLASS DIAGRAM 8
5 IMPLEMENTATION 9
6 OUTPUT/SCREENSHOTS 16,17
7 CONCLUSION 18
1. INTRODUCTION
sports.
2. AIM
To develop a program which stores sports details
3.SYSTEM REQUIREMENTS
SOFTWARE REQUIREMENTS:
HARDWARE REQUIREMENTS:
RAM :8GB
Processor:INTEL CORE I5
4.CLASS DIAGRAM
SAMPLE
Registration Form
F:jframe
L:jlabel
C1:jcomboB
ox
Main(string[]):void
new
ActionListener()
new
ActionListener()
termStateChanged(termEvent):void
5. IMPLEMENTATION
package sample; import javax.swing.*; import java.awt.*; import
{
static JFrame f; static
JLabel l; static
JComboBox c1;
JTextArea tadd,resadd,tout;
JCheckBox term;
JButton sub,reset;
f.setTitle("RegistrationForm");
f.setBounds(200,80,1150,700);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setResizable(false);
c=f.getContentPane();
c.setLayout(null);
title=new JLabel("RegistrationForm");
title.setFont(new
Font("Arial",Font.PLAIN,30));
title.setSize(400,30); title.setLocation(420,20);
c.add(title);
Font("Arial",Font.PLAIN,30));
mno.setSize(300,30); mno.setLocation(50,120);
c.add(mno); tname=new
JTextField();
tname.setFont(new Font("Arial",Font.PLAIN,30));
tname.setSize(120,30);
tname.setLocation(275,70);
c.add(tname); tmno= new JTextField();
tmno.setFont(new
Font("Arial",Font.PLAIN,30));
tmno.setSize(120,30);
tmno.setLocation(275,120);
gender.setFont(new Font("Arial",Font.PLAIN,30));
gender.setSize(300,30);
gender.setLocation(50,170);
c.add(gender); male=new
JRadioButton("male");
male.setFont(new
Font("Arial",Font.PLAIN,30));
male.setSelected(true); male.setSize(100,20);
male.setLocation(255,170);
c.add(male);
female=new JRadioButton("female");
female.setFont(new
Font("Arial",Font.PLAIN,30));
female.setSelected(true); female.setSize(200,20);
female.setLocation(395,170);
c.add(female); gengp=new
ButtonGroup();
gengp.add(male);
gengp.add(female);
add=new
JLabel("Address");
add.setFont(new
Font("Arial",Font.PLAIN,30));
add.setSize(3500,30); add.setLocation(50,230);
c.add(add); tadd=new JTextArea();
tadd.setFont(new
Font("Arial",Font.PLAIN,30));
tadd.setSize(300,30);
tadd.setLocation(275,230);
tadd.setLineWrap(true);
c.add(tadd);
term= new JCheckBox("Accept Terms and conditions");
term.setFont(new Font("Arial",Font.PLAIN,30));
term.setSize(450,20); term.setLocation(110,320);
c.add(term);
reset=new JButton("Reset");
reset.setFont(new Font("Arial",Font.PLAIN,30));
reset.setSize(150,25);
reset.setLocation(370,410);
c.add(reset);
sub=new JButton("Submit"); sub.setFont(new
Font("Arial",Font.PLAIN,30));
sub.setSize(150,25); sub.setLocation(100,410);
c.add(sub); res=newJLabel("");
res.setFont(new
Font("Arial",Font.PLAIN,30));
res.setSize(500,30); res.setLocation(50,515);
resadd.setFont(new
Font("Arial",Font.PLAIN,30));
resadd.setSize(200,30);
resadd.setLocation(275,510);
c.add(resadd);
tout=new JTextArea();
tout.setFont(new
Font("Arial",Font.PLAIN,30));
tout.setSize(450,500); tout.setLocation(650,80);
tout.setLineWrap(true); tout.setEditable(false);
f.setVisible(true);
c.add(tout);
sub.addActionListener(new ActionListener()
{ public void actionPerformed(ActionEvent e)
{
if(term.isSelected())
{
String data,data1,data2,data3;
Number:"+tmno.getText() + "\n";
if(male.isSelected())
data1="Gender:"+male.getText() + "\n";
else
data1="Gender:"+female.getText() + "\n";
data2="Address:"+tadd.getText()+"\n";
data3="Sports:"+c1.getSelectedItem();
tout.setText(data+data1+data2+data3);
tout.setEditable(false);
res.setText("Registration successfully....");
}
else
{ tout.setText("Please accept the terms and conditions");
}});
reset.addActionListener(newActionListener()
{ public void
actionPerformed(ActionEvent e)
{ tname.setText("");
tadd.setText("");
tmno.setText("");
res.setText("");
tout.setText("");
term.setSelected(false);
resadd.setText("");
}
});
RegistrationForm s = new RegistrationForm();
String s1[] = { "Kabaddi", "Cricket", "Volley Ball", "Basket Ball", "Hockey"
}; c1 = new
JComboBox(s1);
c1.addItemListener(s);
f.add(l);
f.add(c1);
l.setSize(150,25);
l.setLocation(100,450);
c1.setSize(150,25);
c1.setLocation(100,470);
} public void itemStateChanged(ItemEvent
e)
{
}
}
6 . OUTPUTS
The above screenshot represents the details of students and which game
the had selected
7. CONCLUSION
From the above program we can store the sports details of the students
and we can store the name, id number, gender, address and the game which
the student is interested without maintaining the records which makes to enter
the details more easy the doing manually.