AJP Project
AJP Project
AJP Project
Project Report
On
Certificate
2
Declaration
We hereby declare that the project report entitled “MCQ Exam Page using
The partial fulfillment of the requirement for the award of the diploma of
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
examination body.
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
4
Abstract
the admission system is slow and having many delays in the process.
design and develop the Diploma and local admission process at the
5
Index
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.
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.
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
Swing is more portable and more flexible than AWT, the Swing is built on top of the
AWT.
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;
// Declare components
public MCQPage() {
8
// Frame setup
setTitle("MCQ Page");
setSize(400, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new FlowLayout());
// Initialize components
optionsGroup.add(option1);
optionsGroup.add(option2);
optionsGroup.add(option3);
optionsGroup.add(option4);
// Submit button
9
// TextArea for displaying result
resultArea.setEditable(false);
add(questionLabel);
add(option1);
add(option2);
add(option3);
add(option4);
add(submitButton);
add(resultArea);
submitButton.addActionListener(new ActionListener() {
@Override
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();
if (selectedAnswer != null) {
if (selectedAnswer.equals(correctAnswer)) {
resultArea.setText("Correct!");
} else {
} else {
});
SwingUtilities.invokeLater(new Runnable() {
11
@Override
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