0% found this document useful (0 votes)
38 views29 pages

Ajp MP

Uploaded by

anujgour95357
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)
38 views29 pages

Ajp MP

Uploaded by

anujgour95357
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/ 29

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

VIDYAVARDHINI’S BHAUSAHEB VARTAK


POLYTECHNIC

MICRO PROJECT
Academic year: 2024-2025

Title of Micro Project:


Quiz Application

Program/Code: Computer Engineering (CO) Semester: FIFTH

Course/Code: Advance Java Programming(22517)

Name: Manas, Manish, Om Roll No:1946,1947,1948

Enrollment No: 2200930158, 2200930159, 2200930160

Name of Faculty: Mr.Rajesh Garud


MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION

Certificate

This is to certify that Mr. /Ms.……………………………………………………………


Roll No………… of FIFTH Semester of Diploma in Computer Engineering(CO) of
Institute, B.V. POLYTECHNIC (Code: 0093) has completed the Micro-Project
satisfactorily in Subject–Advance Java Programming (22518) for the academic year
2024-2025 as prescribed in the curriculum.

Place: Vasai Enrolment No: ……………………………………

Date: ……………………… Exam. Seat No: …………………………………….

Subject Teacher Head of the Department Principal

Seal Of
Institution
Annexure - I

Part A: Micro Project Proposal

1.0 Aim/Benefits of the Micro-Project:


The aim of this micro project is to test the Quiz Application. It will help us to inculcate about software
lesson in deep.

2.0 Course Outcomes integrated:

1. Develop effective message handling protocols for chat functionality.


2. Identify and report connection issues systematically.
3. Execute functional testing for user interactions and message delivery.
4. Implement security measures to protect user data and privacy.
5. Apply automation tools for testing server-client communication efficiency.

3.0 Proposed Methodology:


1. Literature survey.
2. Collect information through different sources.
3. Analysis of data.
4. Compilation of collected data.

4.0 Action Plan

Planned Planned Name of


Sr.No. Details of the activity Start date Finish date Members
1 Formation of Group & Topic Selection All members
2 Submission of Proposed Plan All members
3 Preparation of Report All members
4 Final valuation of a working Report All members
5 Presentation of Report All members
6 Submission of Final Report All members

5.0 Resource Required:

Sr.
Name of resources/Material Specifications Qty
No.
Processor: i3
1. Computer 1
RAM : 4.00 GB
2. Microsoft Word Word -2016 1
3. Printer Hp Laser Jet 1
https://www.academia.edu 1
4. Book/ website name
6.0 Name of Team Members with Roll No:

Sr. Process and Individual Total


Roll No Name of Students
No. Product Presentation (10)
assessment (04)
(06)
01 1946 Manas Patil

02 1947 Manish Patil

03 1948 Om Patil

Name & Signature of Faculty: Mr.Rajesh Garud


Annexure- II

Final Micro Project Report

Title: Chatting Application

1.0 Rationale: The rationale behind the Quiz Application like is to ensure the reliability, security, and functionality
of its core features. With millions of daily users, even minor glitches can result in significant user dissatisfaction
and data breaches. By developing comprehensive test cases, testers can identify potential bugs and performance
issues early. This not only improves user experience but also safeguards sensitive information. Effective testing
helps the platform maintain its competitive edge in a fast-evolving digital environment.

2.0 Course Outcomes Integrated:

1. Develop effective message handling protocols for chat functionality.


2. Identify and report connection issues systematically.
3. Execute functional testing for user interactions and message delivery.
4. Implement security measures to protect user data and privacy.
5. Apply automation tools for testing server-client communication efficiency.

3.0Actual Procedure Followed.


1 Discussion about topic with guide and among group members.
2 Literature survey.
3 Information collection.
4 Compilation of content.
5 Editing and revising content.
6 Report Preparation.
7
4.0Actual Resources Required:
Sr.
Name of resources/Material Specifications Qty
No.
Processor: i3
1. Computer 1
RAM : 4.00 GB
2. Microsoft Word Word -2016 1
3. Printer Hp Laser Jet 1
https://www.academia.edu 1
4. Book/Site name

5.0 Skill Developed/Learning outcomes of this Micro-Project


The following skills were developed:
1. Teamwork: Learned to work in a team and boost individual confidence.
2. Problem-Solving: Developed good problem solving habits.
3. Technical Writing: Preparing the report of proposed plan and the final report.
Rubrics for Assessment of Micro-Project
Annexure - III

Title: Quiz Application


Institute Code: 0093 Academic year: 2024-25

Program: CO-II Course & Code: AJP(22517)

Name of Candidate: Roll No:

Semester: FIFTH Name of Faculty: Mr.Rajesh Garud

Sr. Poor Average Good Excellent


Characteristic to be Assessed
No. (Marks 1-3) (Marks 4-5) (Marks 6-8) (Marks 9-10)
1. Relevance to the Course
Literature Survey/Information
2.
Collection
3. Project Proposal
Completion of the Target as per
4.
Project Proposal
5. Analysis of Data and Representation
6. Quality of Prototype/Model
7. Report Preparation
8. Presentation
9. Viva
Annexure- IV

Micro-Project Evaluation Sheet


Title: Quiz Application
Institute Code: 0093 Academic year: 2024-25

Program: CO-II Course & Code: AJP(22517)

Name of Candidate: Roll No:

Semester: FIFTH Name of Faculty: Mr.Rajesh Garud

Course Outcomes Achieved:


1. Develop effective test cases for social media features.
2. Identify and report software bugs systematically.
3. Execute functional testing for user interactions.
4. Implement security testing for data protection.
5. Apply automation tools in social media testing.

Evaluation as per Suggested Rubric for Assessment of Micro Project:


Sr. Characteristic to be Poor Average Good Marks Excellent Sub
No. assessed Marks Marks 4-5 6-8 Marks 9-10 Total
1-3
(A) Process and product assessment Out Of 6
1 Relevance to the course

2 Literature Survey .
Information Collection
3 Completion of the
Target as per project
proposal
4 Analysis of Data and
representation
5 Quality of Prototype
/Model/Content
6 Report Preparation
(B) Individual Presentation/Viva Out of 4
7 Presentation
8 Viva

Name and designation of the Faculty Member: Mr.Rajesh Garud


Weekly Activity Sheet
Topic: Quiz Application
Institute Code: 0093 Academic year: 2024-25

Program: CO-II Course & Code: AJP(22517)

Name of Candidate: Roll No:

Semester: FIFTH Name of Faculty: Mr.Rajesh Garud

SR. NO WEEK ACTIVITY PERFORMED

1. 1st Week Discussion and Finalization of Topic


2. 2nd Week Literature Review
3. 3rd Week Submission of Proposed Plan
4 4th Week Information Collection
5. 5th Week Analysis of Data
6. 6th Week Compilation of content
7. 7th Week Editing and Revising the Content
8. 8th Week Report Preparation
9. 9th Week Report Preparation
10. 10th-12th Week Presentation

Signature of Student Dated Signature of Faculty


INDEX

PAG
SR CONTENT E NO.
NO
.

1. What is? and use of AWT, SWING, EVENT in 10


project.

2. Login Code & Output 11

3. Quiz Code & Output 13

4. Rules Code & Output 16

5. Score Code & Output 18

6. Acknowledgement 20

7. Conclusion & Reference 21


What is AWT? (Abstract Window Toolkit):

• AWT is a Java library for creating graphical user interfaces (GUIs).


• It provides a set of core components like buttons, text fields, labels, and windows.
• AWT is part of the Java Foundation Classes (JFC) and is known for its platform-
dependent nature, meaning it relies on the native system's GUI features.

Usage in Project:

1. Frame Setup: Your JFrame setup for each main class (e.g., Login, Quiz,
Rules, Score) relies on AWT to manage the overall window where
components are displayed.
2. Button and Label Customization: You define and style elements such as
JButton and JLabel for functionality and visual presentation. AWT allows
these buttons and labels to have specific properties for color, size, and fonts.
3. Event Handling: The use of ActionListener for button clicks (start, next,
back, etc.) leverages AWT’s event-handling mechanisms, enabling interactive
behavior for the user.
4. Graphics: In the Quiz class, AWT’s Graphics object handles custom drawing,
like displaying the timer countdown and "Times up" message.
5. Image Handling: AWT is used in scaling images and displaying them in your
frames. The Image and ImageIcon objects facilitate loading, scaling, and
rendering images within your application.

Swing:

• Swing is a Java GUI toolkit that extends AWT, offering more advanced and flexible
components.
• Unlike AWT, Swing is platform-independent and provides lightweight components,
meaning it doesn't rely on the native system’s GUI.
• It includes components like JFrame, JPanel, JButton, JTextField, and JTextArea.

Usage in Project:

1. Component Creation:
JFrame: Each main window, such as Login, Quiz, Rules, and Score, extends
JFrame, which serves as the main container for adding and arranging GUI
components.
JLabel: Used extensively for displaying static text, instructions, headings, and quiz
questions. The JLabel component provides options for text styling, positioning, and
alignment.
JButton: Buttons like "Next," "Submit," "Play Again," and "Start" are built with
JButton. These enable user interaction, each button being configured to trigger
different actions and events based on user choices.
JRadioButton: Used for the multiple-choice options in the Quiz class, allowing
users to select one answer per question. JRadioButton provides a clean, easy-to-
understand layout for multiple-choice selections.
ButtonGroup: To group JRadioButton options together so only one selection can be
made at a time.
2. Layout and Styling:
Swing components allow for customization of fonts, colors, and layout positioning.
Components like JLabel, JButton, and JRadioButton are styled to improve
readability and visual appeal.
3. Event Handling:
Through ActionListener, Swing’s event-handling framework allows buttons and
other interactive elements to respond to user actions, such as moving to the next
question, using a lifeline, or submitting the quiz. Each button click initiates logic
based on user input.
4. Containers and Hierarchy:
The layout of components in JFrame allows you to create different sections (like the
quiz question area, options, and navigation buttons). Swing’s getContentPane() lets
you set backgrounds and layout options directly in the container.
5. User Interaction:
Swing components in combination (e.g., JRadioButton with ButtonGroup, JButton
with ActionListener) allow for a responsive and interactive user experience. They
create a seamless workflow for users, from the login to the quiz and the final scoring
page.

Event:

An event can be defined as changing the state of an object or behavior by performing


actions. Actions can be a button click, cursor movement, keypress through keyboard or
page scrolling, etc. The java.awt.event package can be used to provide various event
classes
Usage in Project:
1. Button Clicks:
• ActionListener is implemented to handle the actions of buttons like "Next,"
"Submit," "Start," and "Play Again."
• Each button has an associated event listener to respond when clicked. For instance:
o In the Rules class, clicking the "Start" button triggers the start of the quiz by
navigating to the Quiz class.
o The "Back" button in Rules and Score classes returns the user to the Login
screen.
o In the Score class, the "Play Again" button takes the user back to the Login
screen, allowing a fresh start.
2. Quiz Navigation:
• In the Quiz class, event handling is used to manage quiz flow:
o The "Next" button, when clicked, progresses to the next question, updating the
displayed question and available answer options.
o The "Submit" button, when clicked, processes the final score, then opens the
Score screen to display the results.
3. Option Selection:
• JRadioButton Selection: Each option in the quiz questions is represented by a
JRadioButton. By using ActionListener, the application detects which radio button is
selected.
• The selected answer can then be processed upon clicking "Next" or "Submit,"
allowing the application to store user answers for score calculation.
4. Form Navigation and Validation:
• Events also manage form navigation and data validation. For instance, in the Login
class, when a user clicks the login button, the application validates the entered name
before proceeding to the Rules screen.
5. Real-Time Interaction with GUI Components:
• Events are essential for creating a responsive UI by updating components in real-
time:
o For example, clicking "Start" in the Rules screen loads the quiz screen,
changing the content displayed to the user.
o Similarly, in the Quiz class, clicking "Next" updates the question and answer
choices on the same screen without opening a new window.
Login Code:

package quiz.application;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Login extends JFrame implements ActionListener{
JButton rules, back;
JTextField tfname;
Login() {
getContentPane().setBackground(Color.WHITE);
setLayout(null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/login.jpeg"));


JLabel image = new JLabel(i1);
image.setBounds(0, 0, 600, 500);
add(image);

JLabel heading = new JLabel("Simple Minds");


heading.setBounds(750, 60, 300, 45);
heading.setFont(new Font("Viner Hand ITC", Font.BOLD, 40));
heading.setForeground(new Color(30, 144, 254));
add(heading);

JLabel name = new JLabel("Enter your name");


name.setBounds(810, 150, 300, 20);
name.setFont(new Font("Mongolian Baiti", Font.BOLD, 18));
name.setForeground(new Color(30, 144, 254));
add(name);

tfname = new JTextField();


tfname.setBounds(735, 200, 300, 25);
tfname.setFont(new Font("Times New Roman", Font.BOLD, 20));
add(tfname);

rules = new JButton("Rules");


rules.setBounds(735, 270, 120, 25);
rules.setBackground(new Color(30, 144, 254));
rules.setForeground(Color.WHITE);
rules.addActionListener(this);
add(rules);

back = new JButton("Back");


back.setBounds(915, 270, 120, 25);
back.setBackground(new Color(30, 144, 254));
back.setForeground(Color.WHITE);
back.addActionListener(this);
add(back);

setSize(1200, 500);
setLocation(200, 150);
setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == rules) {
String name = tfname.getText();
setVisible(false);
new Rules(name);
} else if (ae.getSource() == back) {
setVisible(false);
}
}

public static void main(String[] args) {


new Login();
}
}
Login Code Output:
Quiz Code:

package quiz.application;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Quiz extends JFrame implements ActionListener {
String questions[][] = new String[10][5];
String answers[][] = new String[10][2];
String useranswers[][] = new String[10][1];
JLabel qno, question;
JRadioButton opt1, opt2, opt3, opt4;
ButtonGroup groupoptions;
JButton next, submit, lifeline;

public static int timer = 15;


public static int ans_given = 0;
public static int count = 0;
public static int score = 0;

String name;

Quiz(String name) {
this.name = name;
setBounds(50, 0, 1440, 850);
getContentPane().setBackground(Color.WHITE);
setLayout(null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/quiz.jpg"));


JLabel image = new JLabel(i1);
image.setBounds(0, 0, 1440, 392);
add(image);

qno = new JLabel();


qno.setBounds(100, 450, 50, 30);
qno.setFont(new Font("Tahoma", Font.PLAIN, 24));
add(qno);

question = new JLabel();


question.setBounds(150, 450, 900, 30);
question.setFont(new Font("Tahoma", Font.PLAIN, 24));
add(question);

questions[0][0] = "Which is used to find and fix bugs in the Java programs.?";
questions[0][1] = "JVM";
questions[0][2] = "JDB";
questions[0][3] = "JDK";
questions[0][4] = "JRE";

questions[1][0] = "What is the return type of the hashCode() method in the Object class?";
questions[1][1] = "int";
questions[1][2] = "Object";
questions[1][3] = "long";
questions[1][4] = "void";

questions[2][0] = "Which package contains the Random class?";


questions[2][1] = "java.util package";
questions[2][2] = "java.lang package";
questions[2][3] = "java.awt package";
questions[2][4] = "java.io package";

questions[3][0] = "An interface with no fields or methods is known as?";


questions[3][1] = "Runnable Interface";
questions[3][2] = "Abstract Interface";
questions[3][3] = "Marker Interface";
questions[3][4] = "CharSequence Interface";

questions[4][0] = "In which memory a String is stored, when we create a string using new operator?";
questions[4][1] = "Stack";
questions[4][2] = "String memory";
questions[4][3] = "Random storage space";
questions[4][4] = "Heap memory";

questions[5][0] = "Which of the following is a marker interface?";


questions[5][1] = "Runnable interface";
questions[5][2] = "Remote interface";
questions[5][3] = "Readable interface";
questions[5][4] = "Result interface";

questions[6][0] = "Which keyword is used for accessing the features of a package?";


questions[6][1] = "import";
questions[6][2] = "package";
questions[6][3] = "extends";
questions[6][4] = "export";

questions[7][0] = "In java, jar stands for?";


questions[7][1] = "Java Archive Runner";
questions[7][2] = "Java Archive";
questions[7][3] = "Java Application Resource";
questions[7][4] = "Java Application Runner";

questions[8][0] = "Which of the following is a mutable class in java?";


questions[8][1] = "java.lang.StringBuilder";
questions[8][2] = "java.lang.Short";
questions[8][3] = "java.lang.Byte";
questions[8][4] = "java.lang.String";

questions[9][0] = "Which of the following option leads to the portability and security of Java?";
questions[9][1] = "Bytecode is executed by JVM";
questions[9][2] = "The applet makes the Java code secure and portable";
questions[9][3] = "Use of exception handling";
questions[9][4] = "Dynamic binding between objects";

answers[0][1] = "JDB";
answers[1][1] = "int";
answers[2][1] = "java.util package";
answers[3][1] = "Marker Interface";
answers[4][1] = "Heap memory";
answers[5][1] = "Remote interface";
answers[6][1] = "import";
answers[7][1] = "Java Archive";
answers[8][1] = "java.lang.StringBuilder";
answers[9][1] = "Bytecode is executed by JVM";

opt1 = new JRadioButton();


opt1.setBounds(170, 520, 700, 30);
opt1.setBackground(Color.WHITE);
opt1.setFont(new Font("Dialog", Font.PLAIN, 20));
add(opt1);

opt2 = new JRadioButton();


opt2.setBounds(170, 560, 700, 30);
opt2.setBackground(Color.WHITE);
opt2.setFont(new Font("Dialog", Font.PLAIN, 20));
add(opt2);

opt3 = new JRadioButton();


opt3.setBounds(170, 600, 700, 30);
opt3.setBackground(Color.WHITE);
opt3.setFont(new Font("Dialog", Font.PLAIN, 20));
add(opt3);

opt4 = new JRadioButton();


opt4.setBounds(170, 640, 700, 30);
opt4.setBackground(Color.WHITE);
opt4.setFont(new Font("Dialog", Font.PLAIN, 20));
add(opt4);

groupoptions = new ButtonGroup();


groupoptions.add(opt1);
groupoptions.add(opt2);
groupoptions.add(opt3);
groupoptions.add(opt4);
next = new JButton("Next");
next.setBounds(1100, 550, 200, 40);
next.setFont(new Font("Tahoma", Font.PLAIN, 22));
next.setBackground(new Color(30, 144, 255));
next.setForeground(Color.WHITE);
next.addActionListener(this);
add(next);

lifeline = new JButton("50-50 Lifeline");


lifeline.setBounds(1100, 630, 200, 40);
lifeline.setFont(new Font("Tahoma", Font.PLAIN, 22));
lifeline.setBackground(new Color(30, 144, 255));
lifeline.setForeground(Color.WHITE);
lifeline.addActionListener(this);
add(lifeline);

submit = new JButton("Submit");


submit.setBounds(1100, 710, 200, 40);
submit.setFont(new Font("Tahoma", Font.PLAIN, 22));
submit.setBackground(new Color(30, 144, 255));
submit.setForeground(Color.WHITE);
submit.addActionListener(this);
submit.setEnabled(false);
add(submit);

start(count);

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == next) {
repaint();
opt1.setEnabled(true);
opt2.setEnabled(true);
opt3.setEnabled(true);
opt4.setEnabled(true);

ans_given = 1;
if (groupoptions.getSelection() == null) {
useranswers[count][0] = "";
} else {
useranswers[count][0] = groupoptions.getSelection().getActionCommand();
}

if (count == 8) {
next.setEnabled(false);
submit.setEnabled(true);
}

count++;
start(count);
} else if (ae.getSource() == lifeline) {
if (count == 2 || count == 4 || count == 6 || count == 8 || count == 9) {
opt2.setEnabled(false);
opt3.setEnabled(false);
} else {
opt1.setEnabled(false);
opt4.setEnabled(false);
}
lifeline.setEnabled(false);
} else if (ae.getSource() == submit) {
ans_given = 1;
if (groupoptions.getSelection() == null) {
useranswers[count][0] = "";
} else {
useranswers[count][0] = groupoptions.getSelection().getActionCommand();
}

for (int i = 0; i < useranswers.length; i++) {


if (useranswers[i][0].equals(answers[i][1])) {
score += 10;
} else {
score += 0;
}
}
setVisible(false);
new Score(name, score);
}
}

public void paint(Graphics g) {


super.paint(g);

String time = "Time left - " + timer + " seconds"; // 15


g.setColor(Color.RED);
g.setFont(new Font("Tahoma", Font.BOLD, 25));

if (timer > 0) {
g.drawString(time, 1100, 500);
} else {
g.drawString("Times up!!", 1100, 500);
}

timer--; // 14
try {
Thread.sleep(1000);
repaint();
} catch (Exception e) {
e.printStackTrace();
}

if (ans_given == 1) {
ans_given = 0;
timer = 15;
} else if (timer < 0) {
timer = 15;
opt1.setEnabled(true);
opt2.setEnabled(true);
opt3.setEnabled(true);
opt4.setEnabled(true);

if (count == 8) {
next.setEnabled(false);
submit.setEnabled(true);
}
if (count == 9) { // submit button
if (groupoptions.getSelection() == null) {
useranswers[count][0] = "";
} else {
useranswers[count][0] = groupoptions.getSelection().getActionCommand();
}

for (int i = 0; i < useranswers.length; i++) {


if (useranswers[i][0].equals(answers[i][1])) {
score += 10;
} else {
score += 0;
}
}
setVisible(false);
new Score(name, score);
} else { // next button
if (groupoptions.getSelection() == null) {
useranswers[count][0] = "";
} else {
useranswers[count][0] = groupoptions.getSelection().getActionCommand();
}
count++; // 0 // 1
start(count);
}
}
}

public void start(int count) {


qno.setText("" + (count + 1) + ". ");
question.setText(questions[count][0]);
opt1.setText(questions[count][1]);
opt1.setActionCommand(questions[count][1]);

opt2.setText(questions[count][2]);
opt2.setActionCommand(questions[count][2]);

opt3.setText(questions[count][3]);
opt3.setActionCommand(questions[count][3]);

opt4.setText(questions[count][4]);
opt4.setActionCommand(questions[count][4]);

groupoptions.clearSelection();
}
public static void main(String[] args) {
new Quiz("User");
}
}

Quiz Code Output:


Rules Code:
package quiz.application;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Rules extends JFrame implements ActionListener{
String name;
JButton start, back;

Rules(String name) {
this.name = name;
getContentPane().setBackground(Color.WHITE);
setLayout(null);

JLabel heading = new JLabel("Welcome " + name + " to Simple Minds");


heading.setBounds(50, 20, 700, 30);
heading.setFont(new Font("Viner Hand ITC", Font.BOLD, 28));
heading.setForeground(new Color(30, 144, 254));
add(heading);

JLabel rules = new JLabel();


rules.setBounds(20, 90, 700, 350);
rules.setFont(new Font("Tahoma", Font.PLAIN, 16));
rules.setText(
"<html>"+
"1. You are trained to be a programmer and not a story teller, answer point to point" +
"<br><br>" +
"2. Do not unnecessarily smile at the person sitting next to you, they may also not know the
answer" + "<br><br>" +
"3. You may have lot of options in life but here all the questions are compulsory" + "<br><br>"
+
"4. Crying is allowed but please do so quietly." + "<br><br>" +
"5. Only a fool asks and a wise answers (Be wise, not otherwise)" + "<br><br>" +
"6. Do not get nervous if your friend is answering more questions, may be he/she is doing Jai
Mata Di" + "<br><br>" +
"7. Brace yourself, this paper is not for the faint hearted" + "<br><br>" +
"8. May you know more than what John Snow knows, Good Luck" + "<br><br>" +
"<html>"
);
add(rules);

back = new JButton("Back");


back.setBounds(250, 500, 100, 30);
back.setBackground(new Color(30, 144, 254));
back.setForeground(Color.WHITE);
back.addActionListener(this);
add(back);
start = new JButton("Start");
start.setBounds(400, 500, 100, 30);
start.setBackground(new Color(30, 144, 254));
start.setForeground(Color.WHITE);
start.addActionListener(this);
add(start);

setSize(800, 650);
setLocation(350, 100);
setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == start) {
setVisible(false);
new Quiz(name);
} else {
setVisible(false);
new Login();
}
}

public static void main(String[] args) {


new Rules("User");
}
}

Rules Code Output:


Score Code:
package quiz.application;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Score extends JFrame implements ActionListener {
Score(String name, int score) {
setBounds(400, 150, 750, 550);
getContentPane().setBackground(Color.WHITE);
setLayout(null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/score.png"));


Image i2 = i1.getImage().getScaledInstance(300, 250, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(0, 200, 300, 250);
add(image);

JLabel heading = new JLabel("Thankyou " + name + " for playing Simple Minds");
heading.setBounds(45, 30, 700, 30);
heading.setFont(new Font("Tahoma", Font.PLAIN, 26));
add(heading);

JLabel lblscore = new JLabel("Your score is " + score);


lblscore.setBounds(350, 200, 300, 30);
lblscore.setFont(new Font("Tahoma", Font.PLAIN, 26));
add(lblscore);

JButton submit = new JButton("Play Again");


submit.setBounds(380, 270, 120, 30);
submit.setBackground(new Color(30, 144, 255));
submit.setForeground(Color.WHITE);
submit.addActionListener(this);
add(submit);

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


setVisible(false);
new Login();
}

public static void main(String[] args) {


new Score("User", 0);
}
}
Score Code Output:
ACKNOWLEDGEMENT:

We would like to express our special thanks or gratitude to our professor Mr. Rajesh
Garud for guiding and supporting us in completing the microproject. His advice helped
us tremendously all the time. We are deeply indebted to him as without her constructive
feedback their project would not have been a success.
Also, profound gratitude towards all group’s members without their kind support it
would not have been possible for completion of their microproject. We could learn a lot
of things through their microproject. Once again, we all those who have encouraged and
helped us in preparing their microproject
Conclusion:
The Java Chat Application effectively demonstrates real-time communication
between multiple clients and a server using socket programming. It features a
user-friendly graphical interface built with Swing and AWT, allowing users to
send and receive messages seamlessly. The server broadcasts messages to all
connected clients, ensuring synchronized communication. This project
showcases essential concepts in Java programming, GUI development, and
networking, serving as a solid foundation for future enhancements like user
authentication or multimedia support. Overall, it highlights the potential for
building interactive applications in Java.

Reference:

1. https://www.geeksforgeeks.org/
2. https://en.wikipedia.org/

You might also like