3. 3
About The Organization
APT Technosoft was established by group of experienced and techno savvy
engineers in
2005 at Lucknow.
As on today the company has grown to become a Private limited company and
our performance in delivering quality product in various field of computer services
as
made us a leading organization and has obtain ISO 9001-2008 certification.
We have expanded our activities and operation to meet the requirement of our
clients. An office at Delhi has been started to cater requirement of Delhi based
clients.
Mission
Our mission is to develop most cost effective and latest technology. System based
solution for organization. Our solution has capability for extendibility and can be
upgraded as and when required. Our association with client is not limited to
execution of
order rather we wish to maintain a close relation to services as and when required.
Our Vision
We think them exist an efficient and economical solution to any business problem
and we
endeavor to provide the most economical solution to ensure your business growth.
5. 5
Acknowledgment
I would like to express my deep and sincere gratitude to APT Technosoft (An
ISO 9001:2008) who gave me full support and encouraged me to work in their
company
for my summer training. I am deeply grateful to Mr. Sandeep Kumar Singh for his
help
and Support provided at every step of the project.
Last but not the least, I thank to all my colleagues for their support and co-
operation.
Team Members:
Abhishek Kumar Gupta
Utkarsh Pandey
6. 6
Table Of Content
S.N Topic Name Page No.
1. Preface 7
2. About the language 8
3 Introduction 9
4 System overview 12
5 Justification of Platform 14
6 Database 20
7 Screenshot 22
8 Sample code 29
9 Testing 111
10 conclusion 112
7. 7
PREFACE
Since Software development is difficult and complex process, which require a deep thinking, Clear
concept and efficient logic to solve problem arises during development. So only a few persons
really successes, for a good software developer must have clear concept for situation and great
commands on a language which is used to make proposed software. It also required long time
patient, better understanding and working capability in groups. About 15 years ago software
development is very tedious task, because few languages (C, Assembly) are available that is not so
powerful and easier in use, thus software formulation takes long time and consistency. Now these
days a lot of powerful language and technologies (Java, VB.Net, ASP.Net, JSP.Net) are came in
existence which has special feature and have built in controls in graphical shapes that help me to
Rapid Application Development. In these days software covers all economical area in India but
unfortunately it is not spread out as well as foreign countries. This is my first to convert our
Complex in digitized form that’s done manually that is time consuming and high-cost requirement
process. The proposed system development gradually by deep thinking, lot of discussion and
followed by some important rules that are used in software development. I am extremely thankful
to Mr. Sandeep Kumar Singh (Project Manager, APT Technosft) that has helped me in numerous
ways, without whose active co-operation this system could not have been completed.
8. 8
About the language
What is Java ?
Java is a programming language and platform. Platform is
any hardware or software environment in which program runs, known as platform.
Since java has its own Runtime Environment (JRE) and its api called
platform.
Java was invented by James Gosling at Sun Microsystems Introduced in
1991.It took 18 months to develop first working version of Java. This Language was
initially called Oak( ) but was renamed Java in 1995. Initially Java was used for
building the software for the electronic devices like TV, VCRs and so on.
Java Compilation Process
Java is a language which uses both type of approach compile & Interpreter.
9. 9
ByteCode :--
When we compile any java program with java compiler then compiler produce a
class file. The Class file contains java Bytecode. We can run java Bytecode with any
type of processor & O.S, without changes in source code. Same code can be run with
different-2 platform.
ByteCode instruction is not a machine instruction. This is not a type instruction
which can understand by Microprocessor directly. This is an Intermediate
Instruction. In Second Phase with the help of Interpreter we can change ByteCode
instruction into machine instruction.
Before getting deeply into the subject we will first know how Businesses are related
to Internet. As per the product documentation from a business perspective, there are
three phases of the Internet. The First phase gets back to the early 1990's when
Internet first came into general use and which brought a big revolution for
Businesses. In the First phase of the Internet Businesses designed and launched their
website’s and focused on the number of hits to know how many customers were
visiting their site and interested in their products, etc.
The Second phase is what we are in right now and in this phase, Businesses are
generating revenue through Online Transactions. We are now moving into the Third
phase of the Internet where profit is the main priority. The focus here is to
Businesses effectively communicated with their customers and partners who are
geographically isolated participate in Digital Economy and deliver a wide range of
services. How can that be possible? The answer, with Java.
10. 10
Introduction
The project: “Quiz Application” is a collection of number of different types of
quizzes like technical, games, sports, etc. A user can access/play the entire quiz and
can attempt any of the one. There will be limited number of questions and for each
correct answer user will get a credit score. User can see answers as well as can ask a
query related to it. There are many quiz applications available currently on internet.
But there are few which provide better understanding between users and the appletes
application like, providing proper answers, user query Solving, uploading user
questions as well as answer to it, etc. To develop a user friendly quiz application.
which will contain : Numbers of quiz, Answers to every question, Query solving
regarding any question, Uploading of user question and answer, and to improve the
knowledge level of users. To develop an application which will contain solution to
the above problems. By this application the user will come to know about his/her
level and can learn additional knowledge. Also by this application a user can expand
his/her knowledge among the world.
11. 11
Aim and Objective:
❖ Aim:
“Our aim is to develop an application for the users in which a user can attempt any number of
quizzes related to his/her choice.”
❖ Objective:
The main objective of “Quiz Application” is to facilitate a user friendly environment for all users
and reduces the manual effort. In past days quiz is conducted manually but in further resolution
of the technology we are able to generate the score and pose the queries automatically. The
functional requirements include creating users that are going to participate in the quiz, automatic
score and report generation and administrative tasks like add, delete, update for admin privilege
users. In this application, all the permissions lies with the administrator i.e., specifying the details
of the quiz with checking result will show to interviewee or not, addition of question and
answers, marks for each question, Set timer for each quiz and generate report with score for each
quiz.
Purpose, Scope and Applicability:
Purpose:
This web application provides facility to Play online quiz and practice Grammar, Aptitude, and
G.K., It provides a good platform, where a student not only judges there knowledge/skill but also
they can improve knowledge/skill at the same time.
Scope:
The Scope of this project is very broad in terms of gaining knowledge and sharing knowledge
among worlds.
Few points are: -
• Can be used anywhere and anytime as it is a web-based application.
• This application will be used in educational institutions as well as in the corporate world.
Applicability:
Anyone, whether a newcomer or professional, willing to learn they can choose it.
All users will have access to all subject containing subtopics
Users will receive the best experience without any interruptions.
12. 12
Description:
Firstly, we have to make interfaces for Home Page, Login Page, Questions Attempting forum,
Result Page, & Profile of user. These all pages have connectivity with the server and database.
So, that it can work properly. Currently, there are websites which only provide limited number of
quizzes related to different domain. Many websites do not have a single platform for quizzes
related to technical, G.K, Aptitude, Games, etc. And there is not a website where the users can
upload his/her questions and answers for the others. We have to develop an application which
can resolve all of the above problems. By this user can gain knowledge, can solve his/her query,
and spread his/her knowledge among the world.
Methodology:
The programming language used for the development of the project is JAVA.
MySQL is used for Database.
Assumptions:
We assume that the users of our Application should have a minimal Knowledge of computer
system and should have an availability of internet. We are dependent on the sources from where
we have gathered the data and the data are authenticated.
13. 13
Proposed System:
Unlike the other Application where you need to make account for every quiz you want to play,
but using this application, you just have to login by user name and password and then you will
get access to all quizzes from it.
The proposed system is an application will help in improving the knowledge and accuracy.
Requirement Analysis:
Hardware Requirement :
Most current Computers and Laptop have enough specifications to be used to create an
Application. The most important specification to check on the computer would be the size of the
RAM, which should be over 2 GB, more is better. This will ensure that the computer runs
quickly and smoothly, even with heavier programs. The computer should have a keyboard and
mouse attached and working as well.
S.NO NAME HARDWARE
1 Processor Intel dual core (32 bit)
2 RAM 4 GB
3 Processor Speed 2 GHz
Software Requirement:
Aside from a Computer and internet connection, most of the tools you need to build an
Application are Software Program. Some of which may already be on your computer
S.NO NAME SOFTWARE
1 Platform Windows 7,8,8.1,10,11
2 Language Used Net beans
3 Database tool MySQL
14. 14
Justification of Platform:
Justification means why I choose this project to make because not just for making Project
for College It is for improving my skills.
❖Why Net beans :
Net beans is an open-source Integrated Development Environment (IDE) . It is used to
develop applications with JAVA, PHP, C++, HTML and many other Programming languages.
The applications are developed using modules in JAVA. Net beans can run on any operating
system such as windows, Macos, Linux etc.
Apache Net beans provides editors, wizards and templates to help you create applications in
JAVA, PHP and many other languages. The IDE simplifies the development of web, enterprise,
desktop and mobile applications that use .The JAVA and HTML5 platforms.
Advantages:
• Netbeans is very efficient in code development and java web development.
• Netbeans is a great tool to small as it is quite easy to use. its integration is great with other tools.
❖ Why MySQL:
MySQL is a relational database management system based on SQL- Structure Query Language.
The application is used for a wide range of purposes, including data warehousing, e-commerce and
logging applications. The most common use for MySQL is for the purpose of a web database.
MySQL creates a database for storing and manipulating data, defining the relationship of each
table. Clients can make request by typing specific SQL statements on MySQL.
Advantages:
• MySQL is more secure.
• MySQL is available for free to download and use from the official site of MySQL.
15. 15
Requirements Specification
The systems primary focus should be on providing a user friendly easy to understand
interface, which can be used easily and simply by anyone.
Functional Requirements:
System Feature-
This section gives a functional requirement that applicable to the online Quiz.
There are two modules in this phase:
• Student/user module.
• Admin module.
Functionality of each module are:
Student/user module:
The student/user have to login in application. They can choose any of the given Quiz. Then
the student/user will get result immediately after the completion of test.
Admin module:
The admin can see all the tables in the Database and can add the
Question by selecting the particular topic.
Product Preliminary Description:
Product Perspective:
The Quiz Application is an educational platform built for those students and professionals who
have interest in Government exams and gaining knowledge. The admin of our application can
keep all the Quizzes updated all the time so that members get updated information. Here, various
Quizzes will be available with different topics and description. Users can provide their valuable
feedback and even contact us if there is any issue. The main users are : Admin (who can add,
update or remove any Quiz and information)and Members (who are here to study).
16. 16
Waterfall Process model
The Classical Life Cycle or waterfall Process Model was the first process model to present a
sequential framework, describing basic stages that are mandatory for a successful software
development model. It formed the basis for most software development standards and consists of
the following phases: Requirement analysis, design, coding, testing, and maintenance.
Advantages of waterfall model:
• Simple goal.
• Simple to understand and use.
• Clearly defined stages.
• Easy to arrange tasks.
• Process and result are well documented.
• Customers / end users already know about it.
• Easy to manage.
Disadvantage of Waterfall model:
• Rigid design and inflexible procedure.
• Waterfall model faced “Inflexible point solution” which meant even small amendments
in the design were difficult to incorporate later design phase.
• As the requirement were froze before moving to the design phase, using the incomplete
set of requirement, a complete design was worked amendments In case of a large project,
completing a phase and then moving back to reconstruct the same phase, incurred a large
overhead.
• Once a phase is done, it is not repeated again that is movement in the waterfall goes one
to the next and the vice versa is not supported, deadlines are difficult to meet I case of
large projects.
20. 20
Database
A database is information that is set up for easy access, management and updating. Computer
databases typically store aggregations of data records or files that contain information, such as sales
transactions, customer data, financials and product information.
Quiz Table:
29. 29
Simple Code
Main Page
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package quiz;
import java.awt.Toolkit;
import javax.swing.JOptionPane;
/**
*
* @author HP-PC
*/
public class Mpage extends javax.swing.JFrame {
/**
* Creates new form Mpage
*/
public Mpage() {
initComponents();
setIcon();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jButton1 = new javax.swing.JButton();
CmdAdmin = new javax.swing.JButton();
31. 31
pack();
setLocationRelativeTo(null);
}// </editor-fold>
private void CmdAdminActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.setVisible(false);
new LoginAdmin().setVisible(true);
}
private void CmdExitActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a=JOptionPane.showConfirmDialog(this,"Do you really Exit
Application","Select",JOptionPane.YES_NO_OPTION);
if(a==0)
{
System.exit(0);
}
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.setVisible(false);
new StudentDetails().setVisible(true);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Mpage.class.getName()).log(java.util.logging.Level.SEVERE,
32. 32
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Mpage.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Mpage.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Mpage.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Mpage().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton CmdAdmin;
private javax.swing.JButton CmdExit;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
// End of variables declaration
private void setIcon() {
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("abc.jpg")));
}
}
User Registration
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package quiz;
import java.sql.*;
33. 33
import java.text.SimpleDateFormat;
import java.util.Date;
import Project.ConnectionProvider;
import java.awt.Color;
import java.awt.color.*;
import javax.swing.JOptionPane;
/**
*
* @author HP-PC
*/
public class StudentDetails extends javax.swing.JFrame {
/**
* Creates new form StudentDetails
*/
public StudentDetails() {
initComponents();
SimpleDateFormat dform=new SimpleDateFormat("dd-MM-yyyy");
Date date=new Date();
dlbl.setText(dform.format(date));
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
dlbl = new javax.swing.JLabel();
CmdBack = new javax.swing.JButton();
CmdClose = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
34. 34
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
rtf = new javax.swing.JTextField();
ntf = new javax.swing.JTextField();
ftf = new javax.swing.JTextField();
mtf = new javax.swing.JTextField();
gcmb = new javax.swing.JComboBox();
ctf = new javax.swing.JTextField();
etf = new javax.swing.JTextField();
hstf = new javax.swing.JTextField();
istf = new javax.swing.JTextField();
hptf = new javax.swing.JTextField();
iptf = new javax.swing.JTextField();
hytf = new javax.swing.JTextField();
iytf = new javax.swing.JTextField();
utf = new javax.swing.JTextField();
gptf = new javax.swing.JTextField();
gytf = new javax.swing.JTextField();
CmdSave = new javax.swing.JButton();
atf = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jLabel16 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(255, 153, 0));
setUndecorated(true);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/index student.png")));
// NOI18N
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1,
59));
jLabel2.setFont(new java.awt.Font("Algerian", 1, 48)); // NOI18N
jLabel2.setText("Fill up the form");
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(67, 0, 445,
-1));
jLabel3.setFont(new java.awt.Font("Verdana", 1, 20)); // NOI18N
jLabel3.setText("Date:");
getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(606, 13, -1,
-1));
dlbl.setFont(new java.awt.Font("Verdana", 1, 20)); // NOI18N
39. 39
});
getContentPane().add(utf, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 440, 300, -
1));
gptf.setFont(new java.awt.Font("Verdana", 1, 18)); // NOI18N
gptf.setForeground(new java.awt.Color(204, 204, 204));
gptf.setText("Percentage");
gptf.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
gptfFocusGained(evt);
}
});
getContentPane().add(gptf, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 440, 130,
-1));
gytf.setFont(new java.awt.Font("Verdana", 1, 18)); // NOI18N
gytf.setForeground(new java.awt.Color(204, 204, 204));
gytf.setText("Year Passout");
gytf.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
gytfFocusGained(evt);
}
});
getContentPane().add(gytf, new org.netbeans.lib.awtextra.AbsoluteConstraints(720, 440, 150,
-1));
CmdSave.setFont(new java.awt.Font("Verdana", 1, 20)); // NOI18N
CmdSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/save.png"))); //
NOI18N
CmdSave.setText("Save & Next");
CmdSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CmdSaveActionPerformed(evt);
}
});
getContentPane().add(CmdSave, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 560,
250, 50));
atf.setFont(new java.awt.Font("Verdana", 1, 18)); // NOI18N
getContentPane().add(atf, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 500, 850, -
1));
jTextArea1.setEditable(false);
jTextArea1.setColumns(20);
jTextArea1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N
jTextArea1.setRows(5);
jTextArea1.setText("Before the examination day at digital examinationsnPlease make sure
that:n• you have an active user account at UiB. Log on to webmail.uib.no, miside.uib.no or
40. 40
another UiB-service to see if your account is active.n• you remember the password for your UiB-
account. If you have forgotten your password, you can change it at sebra.uib.no.n• If you are
using your personal laptop, please make sure that you have installed the necessary software and
programs before the examination day. It is important that your laptop fulfils the system
requirements of the programme.n• You must bring your own power supply for use during the
examination.n• If failure to comply with these recommendations results in technical problems
that cause a delay in your examination, you cannot expect to be granted extended time.n");
jScrollPane1.setViewportView(jTextArea1);
getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(880,
70, 410, 400));
jLabel16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pages background
student.jpg"))); // NOI18N
getContentPane().add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0,
1310, 700));
jPanel2.setBackground(new java.awt.Color(255, 204, 0));
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 60, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 700, Short.MAX_VALUE)
);
getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(1300, 0,
60, 700));
pack();
setLocationRelativeTo(null);
}// </editor-fold>
private void CmdBackActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.setVisible(false);
new Mpage().setVisible(true);
}
private void CmdCloseActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a=JOptionPane.showConfirmDialog(this,"Do you really Exit
Application","Select",JOptionPane.YES_NO_OPTION);
if(a==0)
41. 41
{
System.exit(0);
}
}
private void hstfFocusGained(java.awt.event.FocusEvent evt) {
// TODO add your handling code here:
if(hstf.getText().equals("Enter Your University Name"))
{
hstf.setText("");
hstf.setForeground(new Color(0,0,0));
}
}
private void istfFocusGained(java.awt.event.FocusEvent evt) {
// TODO add your handling code here:
if(istf.getText().equals("Enter Your University Name"))
{
istf.setText("");
istf.setForeground(new Color(0,0,0));
}
}
private void utfFocusGained(java.awt.event.FocusEvent evt) {
// TODO add your handling code here:
if(utf.getText().equals("Enter Your University Name"))
{
utf.setText("");
utf.setForeground(new Color(0,0,0));
}
}
private void hptfFocusGained(java.awt.event.FocusEvent evt) {
// TODO add your handling code here:
if(hptf.getText().equals("Percentage"))
{
hptf.setText("");
hptf.setForeground(new Color(0,0,0));
}
}
private void iptfFocusGained(java.awt.event.FocusEvent evt) {
// TODO add your handling code here:
if(iptf.getText().equals("Percentage"))
{
iptf.setText("");
iptf.setForeground(new Color(0,0,0));
46. 46
package quiz;
import javax.swing.JOptionPane;
/**
*
* @author HP-PC
*/
public class SetInstruction extends javax.swing.JFrame {
public String rollno;
/**
* Creates new form SetInstruction
*/
public SetInstruction() {
initComponents();
}
public SetInstruction(String rollno1) {
//To change body of generated methods, choose Tools | Templates.
initComponents();
JOptionPane.showMessageDialog(this, rollno1);
rollno=rollno1;
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
CmdStart = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setFont(new java.awt.Font("Algerian", 1, 48)); // NOI18N
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/index student.png")));
// NOI18N
jLabel1.setText(" Instruction");
47. 47
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 499,
88));
getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 90,
1048, 10));
jTextArea1.setEditable(false);
jTextArea1.setColumns(20);
jTextArea1.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N
jTextArea1.setRows(5);
jTextArea1.setText(" Before the examination startsn Arrive at the examination venue at least
15 minutes before the start of the examination / 35 minutes before a digital examination.nLaw:
The examination starts at the moment the book control begins, and you must therefore be present
by 8.20 a.m. for regular written examinations and 8.10 a.m. at digital examinations.nWhen using a
laptop at digital examinations, the laptop has to be set up as soon as possible. If you are taking a
law exam, the laptop must be set up before the book control.nCoats, backpacks, bags, etc. must be
placed as directed. Mobile phones, mp3 players, smartwatches and other electronic devices must be
turned off and put away, and cannot be stored in coats or pockets.nIf support material, other than
that which is specifically permitted, is found at or by the desk, it may be treated as an attempt to
cheat and relevant procedures for cheating will be followed.");
jScrollPane1.setViewportView(jTextArea1);
getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10,
119, 1021, 406));
CmdStart.setFont(new java.awt.Font("Algerian", 1, 24)); // NOI18N
CmdStart.setText("Start Quiz /Exam");
CmdStart.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CmdStartActionPerformed(evt);
}
});
getContentPane().add(CmdStart, new org.netbeans.lib.awtextra.AbsoluteConstraints(306, 557,
397, 59));
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pages background
student.jpg"))); // NOI18N
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1050,
630));
pack();
setLocationRelativeTo(null);
}// </editor-fold>
private void CmdStartActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.setVisible(false);
new QuizExam(rollno).setVisible(true);
}
48. 48
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(SetInstruction.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(SetInstruction.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(SetInstruction.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(SetInstruction.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new SetInstruction().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton CmdStart;
private javax.swing.JLabel jLabel1;
49. 49
private javax.swing.JLabel jLabel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTextArea jTextArea1;
// End of variables declaration
}
Quiz Exam
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package quiz;
import Project.ConnectionProvider;
import java.sql.*;
import java .awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java .util.Date;
import javax.swing.JOptionPane;
import javax.swing.Timer;
/**
*
* @author HP-PC
*/
public class QuizExam extends javax.swing.JFrame {
public String QuestionId="1";
public String answer;
public int min=00;
public int sec=00;
public int marks=0;
public void answerCheck(){
String studentAnswer="";
if(rb1.isSelected())
{
studentAnswer=rb1.getText();
}
else if(rb2.isSelected())
{
studentAnswer=rb2.getText();
}
else if(rb3.isSelected())
{
51. 51
catch(Exception ex)
{
JOptionPane.showMessageDialog(this,ex);
}
int j=Integer.parseInt(qn.getText());
if(j==10)
{
CmdNext.setVisible(false);
}
}
public void submit(){
answerCheck();
String rollno=rbl.getText();
try{
Connection con=ConnectionProvider.getCon();
Statement st=con.createStatement();
st.executeUpdate("update student set mark='"+marks+"'where rollno='"+rollno+"'");
String marks1=String.valueOf(marks);
setVisible(false);
new Submit(marks1).setVisible(true);
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(this, ex);
}
}
/**
* Creates new form QuizExam
*/
public QuizExam(String rollno) {
initComponents();
SimpleDateFormat dform=new SimpleDateFormat("dd-MM-yyyy");
Date date=new Date();
dt.setText(dform.format(date));
rbl.setText(rollno);
try{
Connection con=ConnectionProvider.getCon();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from student where rollno='"+rollno+"'");
while(rs.next())
{
nm.setText(rs.getString(2));
}
52. 52
ResultSet rs1=st.executeQuery("select * from question where id='"+QuestionId+"'");
while(rs1.next())
{
qn.setText(rs1.getString(1));
qd.setText(rs1.getString(2));
rb1.setText(rs1.getString(3));
rb2.setText(rs1.getString(4));
rb3.setText(rs1.getString(5));
rb4.setText(rs1.getString(6));
answer=rs1.getString(7);
}
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(this,ex);
}
setLocationRelativeTo(this);
time=new Timer(1000,new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
sc.setText(String.valueOf(sec));
mn.setText(String.valueOf(min));
if(sec==60)
{
sec=00;
min++;
if(min==10)
{
time.stop();
answerCheck();
submit();
}
}
sec++;
}
});
time.start();
}
Timer time;
public QuizExam() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
53. 53
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
dt = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
mn = new javax.swing.JLabel();
sc = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
sc1 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
rbl = new javax.swing.JLabel();
nm = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
qn = new javax.swing.JLabel();
mk = new javax.swing.JLabel();
qd = new javax.swing.JLabel();
rb1 = new javax.swing.JRadioButton();
rb2 = new javax.swing.JRadioButton();
rb3 = new javax.swing.JRadioButton();
rb4 = new javax.swing.JRadioButton();
CmdNext = new javax.swing.JButton();
CmdSbt = new javax.swing.JButton();
jLabel21 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jPanel1.setBackground(new java.awt.Color(0, 255, 255));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/index student.png")));
// NOI18N
jLabel2.setFont(new java.awt.Font("Algerian", 1, 50)); // NOI18N
60. 60
question();
}
private void CmdSbtActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a=JOptionPane.showConfirmDialog(this,"Do you really want to
submit","select",JOptionPane.YES_NO_OPTION);
if(a==0)
{
answerCheck();
submit();
}
}
private void rb1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(rb1.isSelected())
{
rb2.setSelected(false);
rb3.setSelected(false);
rb4.setSelected(false);
}
}
private void rb2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(rb2.isSelected())
{
rb1.setSelected(false);
rb3.setSelected(false);
rb4.setSelected(false);
}
}
private void rb3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(rb3.isSelected())
{
rb1.setSelected(false);
rb2.setSelected(false);
rb4.setSelected(false);
}
}
61. 61
private void rb4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(rb4.isSelected())
{
rb2.setSelected(false);
rb3.setSelected(false);
rb1.setSelected(false);
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(QuizExam.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(QuizExam.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(QuizExam.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(QuizExam.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
}
//</editor-fold>
62. 62
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new QuizExam().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton CmdNext;
private javax.swing.JButton CmdSbt;
private javax.swing.JLabel dt;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JLabel mk;
private javax.swing.JLabel mn;
private javax.swing.JLabel nm;
private javax.swing.JLabel qd;
private javax.swing.JLabel qn;
private javax.swing.JRadioButton rb1;
private javax.swing.JRadioButton rb2;
private javax.swing.JRadioButton rb3;
private javax.swing.JRadioButton rb4;
private javax.swing.JLabel rbl;
private javax.swing.JLabel sc;
private javax.swing.JLabel sc1;
// End of variables declaration
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
63. 63
package quiz;
/**
*
* @author HP-PC
*/
public class Submit extends javax.swing.JFrame {
/**
* Creates new form Submit
*/
public Submit() {
initComponents();
}
public Submit(String marks1) {
initComponents();
//int i=2;
String marks="Marks Obtained :"+marks1;
//int i=Integer.parseInt(marks);
//i=i-2;
rsl.setText(marks);
}
Submit(int marks1) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of
generated methods, choose Tools | Templates.
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
rsl = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
rsl1 = new javax.swing.JLabel();
rsl2 = new javax.swing.JLabel();
rsl3 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
65. 65
pack();
setLocationRelativeTo(null);
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
setVisible(false);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Submit.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Submit.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Submit.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Submit.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
66. 66
new Submit().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel rsl;
private javax.swing.JLabel rsl1;
private javax.swing.JLabel rsl2;
private javax.swing.JLabel rsl3;
// End of variables declaration
}
Admin Login
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package quiz;
import javax.swing.*;
/**
*
* @author HP-PC
*/
public class AdminHome extends javax.swing.JFrame {
public static int open=0;
/**
* Creates new form AdminHome
*/
public AdminHome() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
67. 67
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
Addnewquest = new javax.swing.JMenu();
Updateques = new javax.swing.JMenu();
Allques = new javax.swing.JMenu();
Delete = new javax.swing.JMenu();
res = new javax.swing.JMenu();
MenuLg = new javax.swing.JMenu();
MenuExt = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/index
background.png"))); // NOI18N
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -120, -1,
770));
jMenuBar1.setBackground(new java.awt.Color(255, 0, 51));
jMenuBar1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Navigation Bar",
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 1, 36),
new java.awt.Color(255, 0, 0))); // NOI18N
Addnewquest.setIcon(new javax.swing.ImageIcon(getClass().getResource("/add new
question.png"))); // NOI18N
Addnewquest.setText("Add New Question");
Addnewquest.setFont(new java.awt.Font("Verdana", 1, 14)); // NOI18N
Addnewquest.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
AddnewquestMouseClicked(evt);
}
});
jMenuBar1.add(Addnewquest);
Updateques.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Update
Question.png"))); // NOI18N
Updateques.setText("Update Questiion");
Updateques.setFont(new java.awt.Font("Verdana", 1, 14)); // NOI18N
Updateques.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
UpdatequesMouseClicked(evt);
69. 69
MenuLgActionPerformed(evt);
}
});
jMenuBar1.add(MenuLg);
MenuExt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Close.png"))); //
NOI18N
MenuExt.setText("Exit");
MenuExt.setFont(new java.awt.Font("Verdana", 1, 14)); // NOI18N
MenuExt.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
MenuExtMouseClicked(evt);
}
});
MenuExt.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
MenuExtActionPerformed(evt);
}
});
jMenuBar1.add(MenuExt);
setJMenuBar(jMenuBar1);
pack();
setLocationRelativeTo(null);
}// </editor-fold>
private void MenuLgMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
int a=JOptionPane.showConfirmDialog(jf,"Do you want to
Logout","Select",JOptionPane.YES_NO_OPTION);
if(a==0)
{
this.setVisible(false);
new LoginAdmin().setVisible(true);
}
}
private void MenuExtMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
int a=JOptionPane.showConfirmDialog(jf,"Do you want to
Exit","Select",JOptionPane.YES_NO_OPTION);
if(a==0)
{
70. 70
System.exit(0);
}
}
private void AddnewquestMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
if(open==0)
{
new AddNewQues().setVisible(true);
open=1;
}
else
{
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf,"one form already open");
}
}
private void UpdatequesMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
if(open==0)
{
new UpdateQues().setVisible(true);
open=1;
}
else
{
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf,"one form already open");
}
}
private void AllquesMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
if(open==0)
{
new AllQues().setVisible(true);
open=1;
}
else
{
JFrame jf=new JFrame();
71. 71
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf,"one form already open");
}
}
private void DeleteMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
if(open==0)
{
new Delete().setVisible(true);
open=1;
}
else
{
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf,"one form already open");
}
}
private void MenuExtActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void MenuLgActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void resMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
if(open==0)
{
new result().setVisible(true);
open=1;
}
else
{
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf,"one form already open");
}
}
/**
* @param args the command line arguments
72. 72
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(AdminHome.class.getName()).log(java.util.logging.Level.SEV
ERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(AdminHome.class.getName()).log(java.util.logging.Level.SEV
ERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(AdminHome.class.getName()).log(java.util.logging.Level.SEV
ERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(AdminHome.class.getName()).log(java.util.logging.Level.SEV
ERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new AdminHome().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JMenu Addnewquest;
private javax.swing.JMenu Allques;
private javax.swing.JMenu Delete;
private javax.swing.JMenu MenuExt;
private javax.swing.JMenu MenuLg;
73. 73
private javax.swing.JMenu Updateques;
private javax.swing.JLabel jLabel1;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenu res;
// End of variables declaration
}
Add Question
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package quiz;
import javax.swing.*;
import java.sql.*;
import Project.ConnectionProvider;
/**
*
* @author HP-PC
*/
public class AddNewQues extends javax.swing.JFrame {
/**
* Creates new form AddNewQues
*/
public AddNewQues() {
initComponents();
try{
Connection con=ConnectionProvider.getCon();
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select count(Id)from question");
if(rs.first())
{
int id=rs.getInt(1);
id=id+1;
String str=String.valueOf(id);
idlbl.setText(str);
}
else
{
idlbl.setText("1");
}
}
74. 74
catch(Exception ex)
{
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf,ex);
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
CmdClose = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
idlbl = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
qtf = new javax.swing.JTextField();
ootf = new javax.swing.JTextField();
totf = new javax.swing.JTextField();
ttotf = new javax.swing.JTextField();
fotf = new javax.swing.JTextField();
atf = new javax.swing.JTextField();
jLabel11 = new javax.swing.JLabel();
CmdSave = new javax.swing.JButton();
CmdClear = new javax.swing.JButton();
jLabel12 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setAlwaysOnTop(true);
setUndecorated(true);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/add new
question.png"))); // NOI18N
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1,
64));
80. 80
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package quiz;
import java.sql.*;
import Project.ConnectionProvider;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
/**
*
* @author HP-PC
*/
public class UpdateQues extends javax.swing.JFrame {
/**
* Creates new form UpdateQues
*/
public UpdateQues() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
CmdClose = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
jLabel3 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
itf = new javax.swing.JTextField();
qtf = new javax.swing.JTextField();
ootf = new javax.swing.JTextField();
totf = new javax.swing.JTextField();
ttotf = new javax.swing.JTextField();
fotf = new javax.swing.JTextField();
atf = new javax.swing.JTextField();
CmdSearch = new javax.swing.JButton();