You are on page 1of 21

lOMoARcPSD|23220013

123 Kamble Aditya AJP - AJP MICRO PROJECT

Computer Engg (Sanjivani College of Engineering, Kopargaon)

Studocu is not sponsored or endorsed by any college or university


Downloaded by svpm ite (technovision22co@gmail.com)
lOMoARcPSD|23220013

A
PROJECT REPORT ON
“ONLINE CLASS TEST”
Subject – Advanced Java Programming (22517)

SUBMITTED BY
Kamble Aditya Balasaheb (200340414)

Submitted to

Sanjivani Rural Education Society’s


Sanjivani. K. B. P. Polytechnic,
Kopargaon-423 601

Affiliated to

Maharashtra State Board of Technical Education (MSBTE), Mumbai

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

SANJIVANI K. B. P. POLYTECHNIC, KOPARGAON


Department of Computer Technology

CERTIFICATE
This is to certify that Mr Kamble Aditya Balasaheb , a student of Department of
Computer Technology having Enrollment No.:2000340414 has completed the micro
project satisfactorily in the subject Advanced Java Programming (22517) for the Academic
Year: 2022-23 & Sem: Fifth(ODD) as prescribed in the curriculum on

“ONLINE CLASS TEST”

Place: Date:

Mr. K.P. Jadhav Mr. G.N Jorvekar Mr. A.R Mirikar


Course Teacher H.O.D Principal

Seal of
Institute

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

MAHARASHTRA STATE BOARD OF TECHNICAL


EDUCATION, MUMBAI

EXAMINERS CERTIFICATE

This is to certify that the project work entitled

“ONLINE CLASS TEST”


Submitted by Kamble
Aditya Balasaheb (2000340414)

For the partial fulfilment of the requirement of Diploma in Computer


Technology is examined and certified

Internal Examiner External


Examiner
(Name of
(Name of Internal) External)

Date:
Place: Kopargaon

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

ACKNOWLEDGEMENT
First and the foremost I, express my deep sense of gratitude, sincere thanks and deep
sense of application to Project Guide Mr. K. P. Jadhav, Department of Computer Technology,
Sanjivani K.B.P. Polytechnic, Kopargaon. Your availability at any time throughout the year,
valuable guidance, opinion, view, comment, critics, encouragement, and support tremendously
boosted this project work.
Lots of thanks to Head of Computer Technology Department, Mr. G. N. Jorvekar for
providing me the best support I ever had. I like to express my sincere gratitude to Mr. A.R.
Mirikar, Principal, Sanjivani K.B.P. Polytechnic, Kopargaon for providing great platform to
complete the project within the scheduled time. I am also Thankful to all the faculty members,
Computer Technology Department, Sanjivani K.B.P. Polytechnic, Kopargaon for giving
comments for improvement of work, encouragement and help during completion of the project.
Last but not the least; We should say thanks from our bottom of heart to our family and
friends for their never ending love, help, and support in so many ways through all this time.
Thank you so much.

Mr Kamble Aditya Balasaheb.

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

Table of Contents

1. Introduction ......................................................................................................... 1
2. Algorithm ............................................................................................................ 2
3. Flowchart ............................................................................................................ 3
4. Program Code ................................................................................................... 4-5
5. Output ..............................................................................................................6-7
6. Conclusion ......................................................................................................... 8

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

INTRODUCTION

Swing is a Java Foundation Classes [JFC] library and an extension of the Abstract Window Toolkit [AWT]. Swing
offers much-improved functionality over AWT, new components, expanded components features, and excellent event
handling with drag-and-drop support.Swing is a Set Of API ( API- Set Of Classes and Interfaces .Swing is Provided
to Design Graphical User Interfaces
Swing is an Extension library to the AWT (Abstract Window Toolkit)
Includes New and improved Components that have been enhancing the looks and Functionality of GUIs’
Swing can be used to build(Develop) The Standalone swing GUI Apps Also as Servlets And Applets
It Employs model/view design architecture
Swing is more portable and more flexible than AWT, The Swing is built on top of the AWT
Swing is Entirely written in Java
Java Swing Components are Platform-independent And The Swing Components are lightweight
Swing Supports a Pluggable look and feels And Swing provides more powerful components
such as tables, lists, Scrollpanes, Colourchooser, tabbedpane, etc
Further Swing Follows MVC.

Features Of Swing Class


Pluggable look and feel
Uses MVC architecture
Lightweight Components
Platform Independent
Advanced features such as JTable, JTabbedPane, JScollPane, etc.

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

ALGORITHM

Step 1: Start
Step 2: Select the right answers of the questions
Step 3: Click on the next button
Step 4: Complete all the questions
Step 5: Check the results by clicking on RESULT button
Step 5: Message Dialog appears which shows the number of correct answers.
Step 6: Enter OK
Step 8: Stop.

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

FLOW CHART
Start

Select the right answers of the questions

Click on the next button

Complete all the questions

Check the results by clicking on result

Message Dialog appears which shows the number of correct answers.

Enter OK

Stop

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

PROGRAM CODE

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import
javax.swing.BorderFactory;
import
javax.swing.border.Border;

class OnlineExam extends


JFrame implements
ActionListener
{
JLabel l;
JRadioButton jb[]=new
JRadioButton[5];
JButton b1,b2;
ButtonGroup bg;
int
count=0,current=0,x=1,y=1,now
=0;
int m[]=new int[10];
JFrame f;
OnlineExam(String s)
{
Font f1 = new
Font("TimesRoman",Font.BOLD
,15);
Border border =
BorderFactory.createLineBorder(
Color.black);

f = new JFrame("Online
class test");
l=new JLabel();
l.setFont(f1);
f.add(l);
bg=new ButtonGroup();

for(int i=0;i<5;i++)
{
jb[i]=new
JRadioButton();

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

f.add(jb[i]);
bg.add(jb[i]);
}
b1=new JButton("Next");
b2=new
JButton("Bookmark");

b1.setBackground(Color.green);
b1.setBorder(border);

b1.setForeground(Color.black);

b2.setBackground(Color.blue);
b2.setBorder(border);

b2.setForeground(Color.white);
b1.addActionListener(this);
b2.addActionListener(this);
f.add(b1);f.add(b2);
set();
l.setBounds(30,40,700,20);

jb[0].setBounds(50,80,150,20);

jb[1].setBounds(50,110,150,20);

jb[2].setBounds(50,140,150,20);

jb[3].setBounds(50,170,150,20);

b1.setBounds(100,240,150,30);

b2.setBounds(270,240,150,30);

f.setDefaultCloseOperation(f.EX
IT_ON_CLOSE);
f.setLayout(null);
f.setLocation(550,450);
f.setVisible(true);

f.getRootPane().setBorder(Borde
rFactory.createMatteBorder(7, 7,
7, 7, Color.red));
f.setSize(700,400);
}

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

public void
actionPerformed(ActionEvent e)
{

if(e.getSource()==b1)
{
if(check())
count=count+1;
current++;
set();
if(current==9)
{
b1.setEnabled(false);
b2.setText("Result");
}
}

if(e.getActionCommand().equals
("Bookmark"))
{
JButton bk=new
JButton("Bookmark"+x);

bk.setBounds(480,20+30*x,100,
30);
add(bk);

bk.addActionListener(this);
m[x]=current;
x++;
current++;
set();
if(current==9)
b2.setText("Result");
setVisible(false);
setVisible(true);
}
for(int i=0,y=1;i<x;i++,y++)
{

if(e.getActionCommand().equals
("Bookmark"+y))
{
if(check())
count=count+1;
now=current;

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

current=m[y];
set();

((JButton)e.getSource()).setEnabl
ed(false);
current=now;
}
}

if(e.getActionCommand().equals
("Result"))
{
if(check())
count=count+1;
current++;

JOptionPane.showMessageDialo
g(this,"correct ans="+count);
System.exit(0);
}
}
void set()
{
jb[4].setSelected(true);
if(current==0)
{
l.setText("Que1: Which
class provides many methods for
graphics programming?");

jb[0].setText("java.awt");jb[1].set
Text("java.Graphics");jb[2].setTe
xt("java.awt.graphics");jb[3].setT
ext("None of the above");
}
if(current==1)
{
l.setText("Que2: By
Which methods you can set or
change the text in a label?");

jb[0].setText("setText()");jb[1].se
tText("getText()");jb[2].setText("
Both A &

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

B");jb[3].setText("None of the
above");
}
if(current==2)
{
l.setText("Que3: Public
class MenuBar
extends___________?");

jb[0].setText("MenuComponent"
);jb[1].setText("MenuContainer")
;jb[2].setText("ComponentMenu"
);jb[3].setText("MenuBar");
}
if(current==3)
{
l.setText("Que4:The
getContentPane() method is of
which class?");

jb[0].setText("JApplet");jb[1].set
Text("JFrame");jb[2].setText("JB
utton");jb[3].setText("None of
these");
}
if(current==4)
{
l.setText("Que5: MVC
architecture is ________?");
jb[0].setText("Modeling-
visual-
controller");jb[1].setText("Model
-view-
controll");jb[2].setText("Many-
View-
controller");jb[3].setText("Model
-viewable-controller");
}
if(current==5)
{
l.setText("Que6:Select
full form of DNS________?");
jb[0].setText("Data
Network
system");jb[1].setText("Domain
Name

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

System");jb[2].setText("Domain
Name
Server");jb[3].setText("Domain
Naming Service");
}
if(current==6)
{
l.setText("Que7: Which
event is genrated when the
position of scrollbar is changed?
");

jb[0].setText("AdjustmentEvent"
);jb[1].setText("MouseEvent");jb
[2].setText("keyEvent");jb[3].set
Text("ItemEVent");
}
if(current==7)
{
l.setText("Que8: UDP
Stands For___?");
jb[0].setText("User Data
Port");jb[1].setText("User data
provider");jb[2].setText("User
data protocol");

jb[3].setText("User Datagram
Protocol ");
}
if(current==8)
{
l.setText("Que9: Port
Number of FTP is____?");

jb[0].setText("21");jb[1].setText(
"80");jb[2].setText("25");jb[3].se
tText("23");
}
if(current==9)
{
l.setText("Que10: SQL
Stands For____?");
jb[0].setText("Structured
Qurey
Language");jb[1].setText("Seque
ntail Qurey

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

Language");jb[2].setText("Struct
ured Question Language");

jb[3].setText("sequentail Qurey
Language");
}
l.setBounds(30,40,450,20);
for(int
i=0,j=0;i<=90;i+=30,j++)

jb[j].setBounds(50,80+i,200,20);
}
boolean check()
{
if(current==0)
return(jb[0].isSelected());
if(current==1)
return(jb[0].isSelected());
if(current==2)
return(jb[3].isSelected());
if(current==3)
return(jb[1].isSelected());
if(current==4)
return(jb[1].isSelected());
if(current==5)
return(jb[2].isSelected());
if(current==6)
return(jb[0].isSelected());
if(current==7)
return(jb[3].isSelected());
if(current==8)
return(jb[0].isSelected());
if(current==9)
return(jb[0].isSelected());
return false;
}
public static void main(String
s[])
{
new OnlineExam("Online
Exams");

}
}

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

OUTPUT

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

Downloaded by svpm ite (technovision22co@gmail.com)


lOMoARcPSD|23220013

CONCLUSION

It was a great experience to design and implement the Swing using Advanced
Java programming and also to work on its documentation. This project helped me in getting
the better understanding of Swings and AWT Components of Advanced Java Programming.
After doing this project, I am in position to explain concepts of Advanced Java Programming
and apply them to the modelling of real-world systems by utilizing its offered facilities. I am
now able to handle events of AWT and swing components and also develop programs using
networking concepts.

Downloaded by svpm ite (technovision22co@gmail.com)

You might also like