79
Class Management System Class Management System Class Management System is a Java GUI application and created on Swing Components like JButton, JTextFields, JCheckBox, JRadioButton,JPanel and so on. This application allows users to insert, delete, update the class, students and lecturer records. Class Management System provides the facility to store the data about students, class and lecturers by means a Student is pursuing which courses from which Lecturer taking which Class. To run the project there are two .bat file i.e. compile and run. Before run the project you have to take these following steps i.e. connectivity steps: 1. Goto Control Panel 2. Open Administrative Tools 3. Choose Data Source (ODBC) 4. Click Add Button 5. Select Server Native Client 10.0 6. Press Finish Button 7. Enter the Name ClassManagementSystem. You can set blank value in Description and Write in Which SQL Server do you want to connect to? Connection String i.e. MYPC\SQLEXPRESS 8. Then Press Finish Button 9. A Dialog Box Appear then press Test Data Source and then OK 10. Press OK Now, Connectivity Process is complete you can compile the whole program using compile.bat file and for run the program you have to run the run.bat file The SQL query for creating the database CMS: create database CMS; use CMS; create table Student (SID varchar(50) primary key, FName varchar(50), LName varchar(50), Mobile varchar(20), Address varchar(100) ); create table Lecturer (LID varchar(50) primary key, FName varchar(50), LName varchar(50), Campus varchar(100), Phone varchar(20) ); [1]

Documentation (1)(1)

Embed Size (px)

DESCRIPTION

nbv jnb

Citation preview

Class Management SystemClass Management System is a Java GUI application and created on Swing Components like JButton, JTextFields, JCheckBox, JRadioButton,JPanel and so on. This application allows users to insert, delete, update the class, students and lecturer records. Class Management System provides the facility to store the data about students, class and lecturers by means a Student is pursuing which courses from which Lecturer taking which Class. To run the project there are two .bat file i.e. compile and run. Before run the project you have to take these following steps i.e. connectivity steps:1. Goto Control Panel2. Open Administrative Tools3. Choose Data Source (ODBC)4. Click Add Button5. Select Server Native Client 10.06. Press Finish Button7. Enter the Name ClassManagementSystem. You can set blank value in Description and Write in Which SQL Server do you want to connect to? Connection String i.e. MYPC\SQLEXPRESS8. Then Press Finish Button9. A Dialog Box Appear then press Test Data Source and then OK10. Press OKNow, Connectivity Process is complete you can compile the whole program using compile.bat file and for run the program you have to run the run.bat fileThe SQL query for creating the database CMS:Class Management System

[40]

create database CMS;use CMS;create table Student(SID varchar(50) primary key,FName varchar(50),LName varchar(50),Mobile varchar(20),Address varchar(100));create table Lecturer(LID varchar(50) primary key,FName varchar(50),LName varchar(50),Campus varchar(100),Phone varchar(20)); create table Class(CID varchar(50) primary key,UnitCode varchar(50),UnitName varchar(50),LID varchar(50) references Lecturer(LID));create table StudentCourse(SID varchar(50) references Student(SID),CID varchar(50) references Class(CID));

These are the following screenshots after running Class Management System:Login Panel

Enter the Login Credentials and you can proceed to Class Management System. The Credentials are as follows:Login: AdminPassword: adminIf the login is incorrect then following dialog box is appear

and then you will resumes the login screen.

Main Form

In the Application Menu, you can exit the Application Software or Press Alt + F4.In the Student Menu:1. You can insert a New Student or press Ctrl + S2. You can Update the Student Details or press Ctrl + Alt +S3. You can Delete the Student or press Ctrl + Shift + SIn the Class Menu:1. You can insert a New Class or press Ctrl + C2. You can Update the Class or press Ctrl + Alt +C3. You can Delete the Class or press Ctrl + Shift + CIn the Lecturer Menu:1. You can insert a New Lecturer or press Ctrl + L2. You can Update the Lesturer or press Ctrl + Alt +L3. You can Delete the Lecturer or press Ctrl + Shift + LIn the Report Menu:1. You can print the Student ReportNew Student

From the Please Select option you can select the Insert, Update and Delete the Student details.

Update Student

Enter the Student ID and press Find button and you will get the information about that student and the information is filled in the given form and press Update button. Update button is currently disabled and it disables until the information is filled in the form.Delete Student

Enter the Student ID and press Find button and you will get the information about that student and the information is filled in the given form and press Delete button. Delete button is currently disabled and it disables until the information is filled in the form. New Class

From the Please Select option you can select the Insert, Update and Delete the Student details.In Insert New Class form you have to enter the Class ID, Unit Code and Unit Name.Update Class

Enter the class ID and press Find button and you will get the information about that class and the information is filled in the given form and press Update button. Update button is currently disabled and it disables until the information is filled in the form. Reset button is used to clear the all fields of the form.

Delete Class

Enter the class ID and press Find button and you will get the information about that class and the information is filled in the given form and press Delete button. Delete button is currently disabled and it disables until the information is filled in the form. Reset button is used to clear the all fields of the given form.

Insert New Lecturer

From the Please Select option you can select the Insert, Update and Delete the Lecturer details. In Insert New Lecturer form you have to entered the Lecturer ID, Name, Campus, Phone and select the course of the student. Reset button is used to clear the all fields of the given form.

Update Lecturer

Enter the Lecturer ID and press Find button and you will get the information about that Lecturer and the information is filled in the given form and press Update button. Update button is currently disabled and it disables until the information is filled in the form. Reset button is used to clear the all fields of the form.

Delete Lecturer

Enter the Lecturer ID and press Find button and you will get the information about that Lecturer and the information is filled in the given form and press Delete button. Delete button is currently disabled and it disables until the information is filled in the form. Reset button is used to clear the all fields of the given form..

Student Report

Enter the Student ID and press Find button and you will get the information about that student. Reset button is used to clear the all fields of the given form.

Class Management System

/*****************************Student Form**********************/package myPackage;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.*;public class studentForm extends JDialog implements ActionListener{JPanel p1,p2,p3,p4;JLabel l0,l1,l2,l3,l4,l5,l6,l7;JTextField t1,t2,t3,t4,t5;TextArea ta1;JButton b1,b2,b3,b4;JRadioButton r1,r2,r3;ButtonGroup bg1;JCheckBox cb[];int rowcount=0;public studentForm(){p1=new JPanel();p2=new JPanel();p3=new JPanel();p4=new JPanel();getContentPane().add(p1);setSize(350,700);// setLocationRelativeTo(null);setLocation(10,50);setVisible(true);setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);setAlwaysOnTop(true);setTitle("Student");setResizable(false);l0=new JLabel("Please Select");l1=new JLabel("Student");l2=new JLabel("Student ID");l3=new JLabel("Name");l4=new JLabel("Mobile");l5=new JLabel("Address");t1=new JTextField(20);t2=new JTextField(20);t3=new JTextField(20);ta1=new TextArea();l1.setFont(new Font("Cambria",Font.BOLD,24));t1.setFont(new Font("Cambria",Font.BOLD,20));t2.setFont(new Font("Cambria",Font.BOLD,18));t3.setFont(new Font("Cambria",Font.BOLD,18));ta1.setFont(new Font("Cambria",Font.BOLD,18));b1=new JButton("Insert");b2=new JButton("Reset");b3=new JButton("Cancel");b4=new JButton("Find");b4.setVisible(false);b1.addActionListener(this);b2.addActionListener(this);b3.addActionListener(this);b4.addActionListener(this);r1=new JRadioButton("New Student");r2=new JRadioButton("Update Student");r3=new JRadioButton("Delete Student");bg1=new ButtonGroup();bg1.add(r1);bg1.add(r2);bg1.add(r3);// p1.setBackground(Color.blue);// p2.setBackground(Color.red);// p3.setBackground(Color.green);p1.setLayout(new BorderLayout());p3.setLayout(null);p1.add(p2,BorderLayout.NORTH);p1.add(p3,BorderLayout.CENTER);p2.add(l1);p3.add( l0);p3.add( r1);p3.add( r2);p3.add( r3);p3.add( l2);p3.add( t1);p3.add( l3);p3.add( t2);p3.add( l4);p3.add( t3);p3.add( l5);p3.add(ta1);p3.add( b1);p3.add( b2);p3.add( b3);p3.add( b4);p3.add( p4); l0.setBounds(10,10,100,30); r1.setBounds(120,10,150,30); r2.setBounds(120,40,150,30); r3.setBounds(120,70,150,30); l2.setBounds(10,110,100,30); t1.setBounds(120,110,80,30); b4.setBounds(210,110,60,30); l3.setBounds(10,150,100,30); t2.setBounds(120,150,205,30); l4.setBounds(10,190,100,30); t3.setBounds(120,190,205,30); l5.setBounds(10,230,100,30);ta1.setBounds(120,230,205,70); p4.setBounds(10,300,320,250); b1.setBounds(20,550,90,40); b2.setBounds(120,550,90,40); b3.setBounds(220,550,90,40); // p4.setBackground(Color.blue); p4.setLayout(new GridLayout(10,2)); l6=new JLabel("Please Select the Course of the Student"); p4.add(l6); hello(); r1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {l1.setText("Insert New Student");b1.setText("Insert");setTitle("New Student");b4.setVisible(false);b1.setEnabled(true);}}); r2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {l1.setText("Update Existing Student");b1.setText("Update");setTitle("Update Student");b4.setVisible(true);b1.setEnabled(false);}});r3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {l1.setText("Delete Student");b1.setText("Delete");setTitle("Delete Student");b4.setVisible(true);b1.setEnabled(false);}});addWindowListener(new WindowAdapter(){public void windowActivated(WindowEvent we){t1.requestFocus();}});}public void actionPerformed(ActionEvent ae){if(ae.getSource()==b1){String s1=new String(b1.getText());String s01=new String(t1.getText());String s02=new String(t2.getText());String s04=new String(t3.getText());String s05=new String(ta1.getText());String s021="";String s022="";for(int i=0,st=0;i