AJP Project

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

“A”

Project Report
On

“MCQ Exam Page using Swing”


Submitted & Present in the fulfilment of therequirement for
the award of

Diploma in Information Technology


By

Mr. Pardeshi Viraj Manoj

Mr. Ambule Prashant Mahadev

Mr. Aware Prathmesh Shashikant


Ms. Chavan Mayuri Tukaram
Under the Guidance of

Prof. Nakhawa D.N.

DEPARTMENT OF INFORMATION TECHNOLOGY

NEW SATARA COLLEGE OF ENGINEERING & MANAGEMENT POLY (2024-2025)


1
NEW SATARA COLLEGE OF ENGINEETING AND
MANAGEMENT KORTI-PANDARPUR

Certificate

This is to certify that the project report “” has been presented


successfully and submitted by.
Name of the Student: - Seat No.
Mr. Viraj Pardeshi 257923
Mr.Prashant Ambule 257924

Mr. Prathmesh Aware 257925


Ms. Mayuri Chavan 257926

Student of IT (Information Technology) class in the fulfilment for


the award of Diploma in Information Technology Engineering as per
curriculum laid by Maharashtra State Board of Technical Education,
Mumbai duringthe academic year 2024-2025.

Project Guide H.O.D Principal


( Prof. Nakhawa D.N.) (Prof. Puri S.B.) (Prof. Londhe V.H.)

2
Declaration

We hereby declare that the project report entitled “MCQ Exam Page using

Swing” is completed and submitted by me for the award of diploma engineering in

Information Technology branch, NSCOEM, College Korti,Pandharpur.

The partial fulfillment of the requirement for the award of the diploma of

INFORMATION TECHNOLOGY is a project work carried out by me under the

guidance of Prof. Nakhwa D.N. I further declare that the work reported in this

project has not submitted and will not be submitted, either in part or full, for

the award of diploma engineering in this institute or any other university or

examination body.

PLACE- KORTI, PANDARPUR


DATE-

Mr. Viraj Pardeshi


Mr. Prashant Ambule
Mr. Prathmesh Aware
Ms. Mayuri Chavan

3
Acknowledgement

I hereby declare that the work presented in this Mini project report
entitled, “MCQ Exam Page using Swing” in partial fulfilment for
the Diploma of "Information Technology" in Computer Science &
Engineering. Our extreme gratitude to Prof. Puri S. B. who guided
us throughout the project. Without his willing disposition, spirit of
accommodation, frankness, timely clarification and above all faith in
us, this project could not have been completed in due time.

Project member:
Mr. Viraj Pardeshi

Mr. Prashant Ambule


Mr. Prathmesh Aware
Ms. Mayuri Chavan

4
Abstract

Student admissions are playing very important role in major

activities of the any university as the basic requirement of the

university is students and without student’s university cannot

survive. An inefficient admission application system may reduce the

number of admitted student in the esteemed university because if

the admission system is slow and having many delays in the process.

When considering Palestine students this is unfortunate, but when

considering Palestinian international students, it can mean the

difference between success and failure because of the large sums of

money each brings to the university’s economy. This project is to

design and develop the Diploma and local admission process at the

institute to develop an easy-to-use system that will significantly

quicken and simplify this process.

5
Index

Sr. No. Topic Page No.


1 Introduction 7-7
2 Program 8-12
3 Output 13-13
4 Conclusion 14-14
5 Reference 15-15

6
Introduction
In
Swing is a Java Foundation Classes [JFC] library and an extension of the Abstract
Window Toolkit [AWT]. Java Swing offers much-improved functionality over AWT, new
components, expanded components features, and excellent event handling with drag-
and-drop support.

Introduction of Java Swing

Swing has about four times the number of User Interface [UI] components as AWT and
is part of the standard Java distribution. By today’s application GUI requirements, AWT
is a limited implementation, not quite capable of providing the components required for
developing complex GUIs required in modern commercial applications. The AWT
component set has quite a few bugs and does take up a lot of system resources when
compared to equivalent Swing resources. Netscape introduced its Internet Foundation
Classes [IFC] library for use with Java. Its Classes became very popular with
programmers creating GUI’s for commercial applications.

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 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 feel and Swing provides more powerful
components.

7
➢ Program of JSWing

import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

public class MCQPage extends JFrame {

// Declare components

private JLabel questionLabel;

private JRadioButton option1, option2, option3, option4;

private ButtonGroup optionsGroup;

private JButton submitButton;

private JTextArea resultArea;

// Sample question and options

private String question = "What is the capital of France?\n";

private String[] options = { "Berlin\n", "Madrid\n", "Paris\n",


"Rome\n" };

private String correctAnswer = "Paris";

public MCQPage() {

8
// Frame setup

setTitle("MCQ Page");

setSize(400, 300);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLayout(new FlowLayout());

// Initialize components

questionLabel = new JLabel(question);

// Create radio buttons for the options

option1 = new JRadioButton(options[0]);

option2 = new JRadioButton(options[1]);

option3 = new JRadioButton(options[2]);

option4 = new JRadioButton(options[3]);

// Group the radio buttons so only one can be selected at a time

optionsGroup = new ButtonGroup();

optionsGroup.add(option1);

optionsGroup.add(option2);

optionsGroup.add(option3);

optionsGroup.add(option4);

// Submit button

submitButton = new JButton("Submit");

9
// TextArea for displaying result

resultArea = new JTextArea(3, 30);

resultArea.setEditable(false);

// Add components to frame

add(questionLabel);

add(option1);

add(option2);

add(option3);

add(option4);

add(submitButton);

add(resultArea);

// ActionListener for the submit button

submitButton.addActionListener(new ActionListener() {

@Override

public void actionPerformed(ActionEvent e) {

// Check which option is selected

String selectedAnswer = null;

if (option1.isSelected()) {

selectedAnswer = option1.getText();

} else if (option2.isSelected()) {

selectedAnswer = option2.getText();

10
} else if (option3.isSelected()) {

selectedAnswer = option3.getText();

} else if (option4.isSelected()) {

selectedAnswer = option4.getText();

// Display the result

if (selectedAnswer != null) {

if (selectedAnswer.equals(correctAnswer)) {

resultArea.setText("Correct!");

} else {

resultArea.setText("Incorrect. The correct answer is " +


correctAnswer + ".");

} else {

resultArea.setText("Please select an answer.");

});

public static void main(String[] args) {

// Make the frame visible

SwingUtilities.invokeLater(new Runnable() {

11
@Override

public void run() {

new MCQPage().setVisible(true);

});

12
Output: -

13
Conclusion

Swing is a Java Foundation Classes [JFC] library and an extension of the Abstract
Window Toolkit [AWT]. Java Swing offers much-improved functionality over AWT, new
components, expanded components features, and excellent event handling with drag-
and-drop support.

Swing has about four times the number of User Interface [UI] components as AWT and
is part of the standard Java distribution. By today’s application GUI requirements, AWT
is a limited implementation, not quite capable of providing the components required for
developing complex GUIs required in modern commercial applications. The AWT
component set has quite a few bugs and does take up a lot of system resources when
compared to equivalent Swing resources. Netscape introduced its Internet Foundation
Classes [IFC] library for use with Java. Its Classes became very popular with
programmers creating GUI’s for commercial applications.

14
References

➢ https://www.naukri.com/code360/library/introduction-to-java-swing
➢ https://www.shareindia.com/knowledge-center/online-share-trading/what-is-
swing-trading

15

You might also like