0% found this document useful (0 votes)
30 views33 pages

Students Profile Management

use full

Uploaded by

power12345srui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views33 pages

Students Profile Management

use full

Uploaded by

power12345srui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Ramrao Adik Institute of Technology

(Department of Computer Engineering)

Mini Project Report


On
Student Profile Management
Subject-: Object Oriented Programing Language

1|Page
TITLE :

STUD
ENT
PROFI

2|Page
t

Serial
Content Page No.
No.
1. AIM 4
2. INTRODUCTION 4
3. PACKAGES 5
4. PROGRAM DETAILS 7
5. SOURCE CODE 14
6. OUTPUT 28

CONTENT

AIM
3|Page
Develop a java based application using GUI to maintain
student record. The application should have a login page. The
application should take student details like name, address,
branch, previous year scores, curricular and extra-curricular
activities and all the entered data should be displayed in the
end for conformation.

INTRODUCTION
A GUI (graphical user interface) is a system of interactive
components such as icons and other graphical objects that
help a user interact with computer software, such as
an operating system.
A GUI is considered to be more user-friendly than a text-
based command-line-interface , such as MS-DOS, or the
shell of Unix-like operating systems.
The GUI was first developed at Xerox-PARC by Alan Kay,
DogulasEngleBart , and a group of other researchers in 1981.
Later, Apple introduced the Lisa computer with a GUI on
January 19, 1983.
A GUI uses windows, icons, and menu to carry out
commands, such as opening, deleting, and moving files.
Although a GUI operating system is primarily navigated using
a mouse, a keyboard can also be used via keyboard
shortcuts or the arrow keys.

Packages
javax.swing

4|Page
Java Swing tutorial is a part of Java Foundation Classes
(JFC) that is used to create window-based applications. It is
built on the top of AWT (Abstract Windowing Toolkit) API
and entirely written in java.Unlike AWT, Java Swing provides
platform-independent and lightweight components.
The javax.swing package provides classes for java swing API
such as JButton, JTextField, JTextArea, JRadioButton,
JCheckbox, JMenu, JColorChooser etc.
java.awt
The java.awt package is the main package of the AWT, or
Abstract Windowing Toolkit. It contains classes for graphics,
including the Java 2D graphics capabilities introduced in the
Java 2 platform, and also defines the basic graphical user
interface (GUI) framework for Java. The most important
graphics classes in java.awt are Graphics and its Java 2D
extension, Graphics2D. These classes represent a drawing
surface, maintain a set of drawing attributes, and define
methods for drawing and filling lines, shapes, and text.
Classes that represent graphgics attributes include Color,
Font, Paint, Stroke, and Composite.

java.awt.event
The java.awt.event package defines classes and interfaces
used for event handling in the AWT and Swing. The
members of this package fall into three categories: Events.

5|Page
The classes with names ending in "Event" represent specific
types of events, generated by the AWT or by one of
the AWT or Swing components.
java.io.file
Java.io package provides classes for system input and output
through files, network streams, memory buffers, etc.
Some input-output stream will be initialized automatically
by the JVM and these streams are available in System class as
in, out, and err variable.
javax.swing.filechooser.FileNameExtensionFilter
An implementation of FileFilter that filters using a specified
set of extensions. The extension for a file is the portion of the
file name after the last ".". Files whose name does not contain
a "." have no file name extension.
java.util.Scanner
Scanner Class in Java. Scanner is a class in java.util
package used for obtaining the input of the primitive types
like int, double, etc. and strings. ... next() function returns the
next token/word in the input as a string and charAt(0) function
returns the first character in that string.

Program Details –
1) LoginFrame :

6|Page
Login Frame is GUI based window that is displayed
when the user first executes the program. It is the
welcome page through which user will move on to the
next frame.
It contains a button with an ActionListener() which on
pressing opens Frame2.

2) Frame2 :
Frame2 is login page. This page takes user id and
password as input and only after successful verification
of user the user is allowed to move to next page.
The default user id password is
User id :- admin
Password :- admin1234

3) Frame3 :
Frame3 is where the user is given the option to enter
their details such as name, age, branch, address and
select their gender from the drop-down menu. Each
detail to be entered are stored using JTextField() and
JRadioButton is used to display the drop-down menu for
the gender selection. Finally, there is the submit details

7|Page
button which on pressing triggers ActionListener() and
checks whether the user given input is legitimate or not,
if it is not then it pops a alert message that reminds the
user to enter the correct details. Once the correct input is
given, we pass this information onto Frame4.

4) Frame4 :
Frame4 is where the user is given the option to enter
their details such as their previous academics
achievements, their 10th,12th scores, their average pointer,
their extra-curricular and co-curricular activites. Each
detail to be entered are stored using JTextField() and
JRadioButton is used to display the drop-down menu for
the gender selection. Finally, there is the submit details
button which on pressing triggers ActionListener() and
checks whether the user given input is legitimate or not,
if it is not then it pops a alert message that reminds the
user to enter the correct details. Once the correct input is
given, we pass this information onto Frame5.

5) Frame5 :

8|Page
Frame5 class is where we receive the user input taken in
Frame3 and Frame4 and using JLabel()’s we display it
on our Java application windows. There are two buttons
to either make a new entry or to exit. On clicking on the
first button, ActionListener() is triggered which calls
Frame3() and thus we can enter details of the another
entry.

6) Student Detials :
This is the final class that contains the main method,
which calls the LoginFrame() .

9|Page
AWT/Swing Functions Used –
1) ActionListener :
ActionListener in Java is a class that is responsible in
handling all action events such as when user clicks in
component, like JButton, the moment user clicks on it,
the ActionListener immediately enforces the action
which was programmed by the programmer.

E.g.
b1.addActionListener( new ActionListener()
{
Public void actionPerformed(ActionEvent e)
{
LoginFrame.this.setVisible(false);
new Frame2();
}
});
In this example we can see that an ActionListener is
added to the JButton b1, then an action is programmed to
take place using the actionPerformed() function. “new
Frame2()” is action set by the user that creates a new
Frame
10 | P a g e
2) JFrame :

The JFrame class is a type of container which inherits the


java.awt.Frame class. JFrame works like the main
window where components like labels, buttons, textfields
are added to create a GUI. It is a container in which you
put all the elements of your window in a GUI
application.

Unlike Frame, JFrame has the option to hide or close the


window with the help of setDefaultCloseOperation(int)
method

3) JButton :

The JButton class is used to create a labeled button that


has platform independent implementation. The
application result in some action when the button is
pushed. It inherits AbstractButton class.
Constructors of the class are:-
JButton() – To create a button with no text and icon.
JButton(String s) – To create a button with the
specified text.

11 | P a g e
JButton(Icon i) – To create a button with a specified
icon object.

3) JLabel :

JLabel is a class of java Swing . JLabel is used to display


a short string or an image icon. JLabel can display text,
image or both . JLabel is only a display of text or image
and it cannot get focus . JLabel is inactive to input events
such a mouse focus or keyboard focus. By default labels
are vertically centered but the user can change the
alignment of label.
Constructor of the class are :
JLabel() - creates a blank label with no text or image in
it.
JLabel(String s) - creates a new label with the string
specified.
JLabel(Icon i) - creates a new label with a image on it.
JLabel(String s, Icon i, int align) - creates a new label
with a string, an image and a specified horizontal
alignment
4) JTextField –

12 | P a g e
JTextField is a part of javax.swing package. The class
JTextField is a component that allows editing of a single
line of text. JTextField inherits the JTextComponent class
and uses the interface SwingConstants.

The constructor of the class are :


JTextField() : constructor that creates a new TextField
JTextField(int columns) : constructor that creates a new
empty TextField with specified number of columns.
JTextField(String text) : constructor that creates a new
empty text field initialized with the given string.
JTextField(String text, int columns) : constructor that
creates a new empty textField with the given string and a
specified number of columns .
JTextField(Document doc, String text, int columns):
constructor that creates a textfield that uses the given text
storage model and the given number of columns.

13 | P a g e
SOURCE CODE
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.io.File;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.util.*;

class LoginFrame extends JFrame


{
JButton b1 , b2;
JLabel l1;
public LoginFrame()
{
super("LOGIN PAGE");
setSize(800 , 550);
setResizable(true);
setLocation(200 , 50);
setLayout(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
b1 = new JButton(" START YOUR REGISTRATION
FORM ");
b1.setBounds(250, 400 , 300 , 50);
add(b1);

l1 = new JLabel();
l1.setBounds(200, 30 , 700 , 300);

14 | P a g e
l1.setIcon(new ImageIcon("9.jpg"));
add(l1);

b1.addActionListener( new ActionListener()


{
public void actionPerformed(ActionEvent e)
{
LoginFrame.this.setVisible(false);
new Frame2();
}
});
setVisible(true);
}
}
class Frame2 extends JFrame
{
JLabel l1,l2;
JTextField t1,t2;
JButton b1;
public Frame2()
{
super("LOGIN PAGE");
setSize(500 , 500);
setResizable(true);
setLocation(200 , 50);
setLayout(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
l1 = new JLabel("USERNAME: ");
l1.setBounds(80,150,150,30);
add(l1);

t1 = new JTextField();
15 | P a g e
t1.setBounds(230,150,200,30);
add(t1);

l2 = new JLabel(" PASSWORD: ");


l2.setBounds(80 , 190 , 150 , 30);
add(l2);

t2 = new JTextField();
t2.setBounds(230 , 190 , 200 , 30);
add(t2);

b1 = new JButton("LOGIN");
b1.setBounds(150 , 330 , 150, 30);
add(b1);

b1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
if(t1.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame2.this,"Please
Enter
USERNAME","ALERT",JOptionPane.ERROR_MESSAGE);
return;
}
else if(t2.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame2.this,"Please Enter
PASSWORD","ALERT",JOptionPane.ERROR_MESSAGE);
return;
}
16 | P a g e
else if(t1.getText().equals("admin") &&
t2.getText().equals("admin1234"))
{
Frame2.this.setVisible(false);
new Frame3();
}
else
{
JOptionPane.showMessageDialog(Frame2.this,"USERID OR
WORNG IS
WORNG","ALERT",JOptionPane.ERROR_MESSAGE);
return;
}
}
});
setVisible(true);
}
}
class Frame3 extends JFrame
{
JLabel l1,l2,l3,l4,l5,l6,l7;
JTextField t1,t2,t3,t4,t5;
JButton b1, b2, b3;
String data;

public Frame3()
{
super("STUDENT DETAILS");
setSize(500 , 500);
setResizable(true);
setLocation(200 , 50);
setLayout(null);
17 | P a g e
setDefaultCloseOperation(EXIT_ON_CLOSE);
l1 = new JLabel("ENTER FIRST NAME ");
l1.setBounds(80 , 50 , 150 , 30);
add(l1);

t1 = new JTextField();
t1.setBounds(230 , 50 , 200 , 30);
add(t1);

l2 = new JLabel("ENTER LAST NAME ");


l2.setBounds(80 , 100 , 150 , 30);
add(l2);

t2 = new JTextField();
t2.setBounds(230 , 100 , 200 , 30);
add(t2);
l3 = new JLabel("SELECT GENDER ");
l3.setBounds(80,150,150,30);
add(l3);

t5 = new JTextField();
t5.setBounds(230,150,200,30);
add(t5);

l4 = new JLabel(" ENTER BRANCH ");


l4.setBounds(80 , 190 , 150 , 30);
add(l4);

t3 = new JTextField();
t3.setBounds(230 , 190 , 200 , 30);
add(t3);

l5 = new JLabel("ENTER ADDRESS ");


18 | P a g e
l5.setBounds(80 , 230 , 150 , 30);
add(l5);

t4 = new JTextField();
t4.setBounds(230 , 230 , 200 , 30);
add(t4);

b2 = new JButton("SUBMIT DETAILS");


b2.setBounds(150 , 330 , 150, 30);
add(b2);
b2.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
if(t1.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame3.this,"Please
Enter FIRST
NAME","ALERT",JOptionPane.PLAIN_MESSAGE);
return;
}
else if(t2.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame3.this,"Please Enter
LAST NAME","ALERT",JOptionPane.PLAIN_MESSAGE);
}
else if(t5.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame3.this,"Please Enter
GENDER","ALERT",JOptionPane.PLAIN_MESSAGE);
}
19 | P a g e
else if(t3.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame3.this,"Please Enter
DEPARTMENT","ALERT",JOptionPane.PLAIN_MESSAG
E);
}
else if(t4.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame3.this,"Please Enter
ADDRESS","ALERT",JOptionPane.PLAIN_MESSAGE);
}
else
{
String s1 = "STUDENT NAME :
"+t1.getText().trim()+" "+t2.getText().trim()+"\n";
String s2 = "ADDRESS : "+t4.getText().trim();
String s3 = "BRANCH : "+t3.getText().trim();
String s4 = "GENDER : "+t5.getText().trim();
Frame3.this.setVisible(false);
new Frame4(s1,s2,s3,s4);
}
}
});
setVisible(true);
}
}
class Frame4 extends JFrame
{
JLabel l1,l2,l3,l4,l5,l6,l7;
JTextField t1,t2,t3,t4,t5;
JButton b1, b2, b3;

20 | P a g e
String data;

public Frame4(String s1, String s2, String s3, String s4)


{
super("STUDENT DETAILS");
setSize(500 , 500);
setResizable(true);
setLocation(200 , 50);
setLayout(null);
final String s5= s1;
final String s6= s2;
final String s7= s3;
final String s8= s4;
setDefaultCloseOperation(EXIT_ON_CLOSE);
l1 = new JLabel("ENTER SSC PERCENTAGE: ");
l1.setBounds(40 , 50 , 150 , 30);
add(l1);

t1 = new JTextField();
t1.setBounds(270 , 50 , 200 , 30);
add(t1);

l2 = new JLabel("ENTER HSC PERCENTGE: ");


l2.setBounds(40 , 100 , 150 , 30);
add(l2);

t2 = new JTextField();
t2.setBounds(270 , 100 , 200 , 30);
add(t2);
l3 = new JLabel("ENTER YOUR AVERAGE
POINTER: ");
l3.setBounds(40,150,200,30);
add(l3);
21 | P a g e
t5 = new JTextField();
t5.setBounds(270,150,200,30);
add(t5);

l4 = new JLabel(" HAVE ENROLED FOR NTPEL:


");
l4.setBounds(40 , 190 , 200 , 30);
add(l4);

t3 = new JTextField();
t3.setBounds(270 , 190 , 200 , 30);
add(t3);

l5 = new JLabel("HAVE YOU JIONED ANY


COMMITIE: ");
l5.setBounds(40 , 230 , 200 , 30);
add(l5);

t4 = new JTextField();
t4.setBounds(270 , 230 , 200 , 30);
add(t4);

b2 = new JButton("CONTINUE");
b2.setBounds(150 , 330 , 150, 30);
add(b2);
b2.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
if(t1.getText().equals(""))
{

22 | P a g e
JOptionPane.showMessageDialog(Frame4.this,"Please
Enter SSC
PERCENTAGE","ALERT",JOptionPane.PLAIN_MESSAGE
);
return;
}
else if(t2.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame4.this,"Please Enter
HSC MARKS","ALERT",JOptionPane.PLAIN_MESSAGE);
}
else if(t5.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame4.this,"Please Enter
AVERAGE
POINTER","ALERT",JOptionPane.PLAIN_MESSAGE);
}
else if(t3.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame4.this,"Please Enter
COMMITTE
NAME","ALERT",JOptionPane.PLAIN_MESSAGE);
}
else if(t4.getText().equals(""))
{
JOptionPane.showMessageDialog(Frame4.this,"Please Enter
NTEPL
COURSE","ALERT",JOptionPane.PLAIN_MESSAGE);
}
else

23 | P a g e
{
String s9 = "SSC PERCENTAGE
"+t1.getText().trim();
String s10 = "HSC PERCENTAGE
"+t2.getText().trim()+"\n";
String s11 = " COMMITTE: "+t4.getText().trim();
String s12 = "NTEPL COURSE NAME :
"+t3.getText().trim();
String s13 = "AVERAGE POINTER :
"+t5.getText().trim();
Frame4.this.setVisible(false);
new Frame5(s5,s6,s7,s8,s9,s10,s11,s12,s13);
}
}
});
setVisible(true);
}
}
class Frame5 extends JFrame
{
JLabel l1 , l2, l3, l4, l5,l6,l7,l8,l9,l10;
JButton b1, b2;

public Frame5(String s1, String s3, String s2, String s4,


String s5, String s6, String s7, String s8,String s9 )
{
super("STUDENT");
setSize(1000 , 900);
setResizable(true);
setLocation(200 , 70);
setLayout(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);

24 | P a g e
l1 = new JLabel(s1);
l1.setBounds(50 , 20 , 300 , 30);
add(l1);

l4 = new JLabel(s4);
l4.setBounds(50 , 70 , 300 , 30);
add(l4);

l2 = new JLabel(s2);
l2.setBounds(50 , 120 , 300 , 30);
add(l2);

l3 = new JLabel(s3);
l3.setBounds(50 , 170 , 300 , 30);
add(l3);
l5 = new JLabel(s5);
l5.setBounds(50 , 220 , 300 , 30);
add(l5);

l6 = new JLabel(s6);
l6.setBounds(50 , 270 , 300 , 30);
add(l6);

l7 = new JLabel(s7);
l7.setBounds(50 , 320 , 300 , 30);
add(l7);

l8 = new JLabel(s8);
l8.setBounds(50 , 370 , 300 , 30);
add(l8);
l9 = new JLabel(s9);
l9.setBounds(50 , 420 , 300 , 30);
25 | P a g e
add(l9);

b1 = new JButton(" MAKE A NEW ENTERY ");


b1.setBounds(250, 400 , 150 , 50);
add(b1);

b2 = new JButton(" EXIT ");


b2.setBounds(400, 400 , 150 , 50);
add(b2);
b1.addActionListener( new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
setVisible(false);
new Frame3();
}
});
b2.addActionListener( new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.exit(0);
}
});

setVisible(true);
}
}
public class Studentdetails
{
public static void main(String [] args)
{
new LoginFrame();
26 | P a g e
}
}

OUTPUT
Welcome page

27 | P a g e
Login Frame

Credential verification

28 | P a g e
User input

User input verification

29 | P a g e
Additional inputs

User input verfication

30 | P a g e
Displaying user details
31 | P a g e
Making new entry

32 | P a g e
CONCLUSION:

Thus, using a GUI based java application we have


successfully created a application with a welcome page , ,
login verification page ,which takes various student details as
input, verifies them and displays it in the end.
A major advantage of GUI is that it makes computer operation
more intuitive and thus easier to learn and use.
Icons are more user friendly than long command lines. GUIs
provide the user with immediate,visual feedback about the
effect of each action.

33 | P a g e

You might also like