├── LICENSE ├── README.md ├── StudentManagementSystem ├── Login.java ├── Menu.java ├── RemoveStudent.java ├── Student.java ├── UpdateStudent.java ├── ViewStudent.java ├── mysql-connector-java-8.0.27.jar └── student.sql └── images ├── addStudent.PNG ├── deleteStudent.PNG ├── login.PNG ├── menu.PNG └── updateStudent.PNG /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Jai Gora 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Student-Management-System 2 | 3 | A Student Management System to manage data of the Students. 4 | 5 | Tech Used : Java, Swing GUI, JDBC
6 | Database : MySQL
7 | Software : Eclipse
8 | Control Panel : xampp, phpmyadmin
9 | Server : Apache
10 | 11 | ## How to run this project? 12 | 13 | **Step 1 :** Copy the repo URL by clicking on clone or download.

14 | **Step 2 :** Go to "File" and then select "Import" in Eclipse IDE

15 | **Step 3 :** Select "Projects from Git (with smart import)

16 | *Step 4 :* Select "Clone URI" & then next

17 | *Step 5 :* Paste the repo URL & then next & then finish

18 | *Step 6 :* Now you can run the project

19 | 20 | ## Application Output 21 | 22 | 23 | login

24 | main-menu

25 | addStudent

26 | deleteStudent

27 | updateStudent

28 | -------------------------------------------------------------------------------- /StudentManagementSystem/Login.java: -------------------------------------------------------------------------------- 1 | package StudentManagement; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.GroupLayout; 10 | import javax.swing.GroupLayout.Alignment; 11 | import javax.swing.JLabel; 12 | import javax.swing.JOptionPane; 13 | import javax.swing.JTextField; 14 | import java.awt.Font; 15 | import javax.swing.JPasswordField; 16 | import javax.swing.JButton; 17 | import java.awt.event.ActionListener; 18 | import java.awt.event.ActionEvent; 19 | import javax.swing.LayoutStyle.ComponentPlacement; 20 | import javax.swing.JDesktopPane; 21 | import java.awt.Color; 22 | 23 | public class Login extends JFrame { 24 | 25 | private JPanel contentPane; 26 | private JTextField username; 27 | private JPasswordField password; 28 | 29 | 30 | public static void main(String[] args) { 31 | EventQueue.invokeLater(new Runnable() { 32 | public void run() { 33 | try { 34 | Login frame = new Login(); 35 | frame.setVisible(true); 36 | } catch (Exception e) { 37 | e.printStackTrace(); 38 | } 39 | } 40 | }); 41 | } 42 | 43 | public Login() { 44 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 45 | setBounds(100, 100, 459, 450); 46 | contentPane = new JPanel(); 47 | contentPane.setBackground(Color.LIGHT_GRAY); 48 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 49 | setContentPane(contentPane); 50 | 51 | JLabel loginUsername = new JLabel("Username"); 52 | loginUsername.setForeground(Color.BLACK); 53 | loginUsername.setFont(new Font("Perpetua Titling MT", Font.BOLD, 14)); 54 | 55 | JLabel loginPassword = new JLabel("Password"); 56 | loginPassword.setForeground(Color.BLACK); 57 | loginPassword.setFont(new Font("Perpetua Titling MT", Font.BOLD, 14)); 58 | 59 | username = new JTextField(); 60 | username.setColumns(10); 61 | 62 | password = new JPasswordField(); 63 | 64 | JButton login = new JButton("Login"); 65 | login.setForeground(Color.BLACK); 66 | login.addActionListener(new ActionListener() { 67 | public void actionPerformed(ActionEvent e) { 68 | 69 | if(username.getText().equals("admin") && password.getText().equals("admin123")) { 70 | Menu menuPage = new Menu(); 71 | menuPage.show(); 72 | dispose(); 73 | } 74 | else if(username.getText().isEmpty() || password.getText().isEmpty()) { 75 | JOptionPane.showMessageDialog(null, "Please enter the Username or Password :("); 76 | } 77 | 78 | else{ 79 | JOptionPane.showMessageDialog(null, "Incorrect Username or Password :("); 80 | } 81 | 82 | 83 | } 84 | }); 85 | login.setFont(new Font("Perpetua Titling MT", Font.BOLD, 14)); 86 | 87 | JDesktopPane desktopPane = new JDesktopPane(); 88 | desktopPane.setBackground(Color.GRAY); 89 | GroupLayout gl_contentPane = new GroupLayout(contentPane); 90 | gl_contentPane.setHorizontalGroup( 91 | gl_contentPane.createParallelGroup(Alignment.LEADING) 92 | .addGroup(gl_contentPane.createSequentialGroup() 93 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 94 | .addGroup(gl_contentPane.createSequentialGroup() 95 | .addContainerGap(65, Short.MAX_VALUE) 96 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 97 | .addGroup(gl_contentPane.createSequentialGroup() 98 | .addComponent(loginPassword) 99 | .addGap(18) 100 | .addComponent(password)) 101 | .addGroup(gl_contentPane.createSequentialGroup() 102 | .addComponent(loginUsername) 103 | .addGap(18) 104 | .addComponent(username, GroupLayout.PREFERRED_SIZE, 216, GroupLayout.PREFERRED_SIZE))) 105 | .addGap(25)) 106 | .addGroup(gl_contentPane.createSequentialGroup() 107 | .addContainerGap() 108 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 408, GroupLayout.PREFERRED_SIZE))) 109 | .addContainerGap(15, Short.MAX_VALUE)) 110 | .addGroup(gl_contentPane.createSequentialGroup() 111 | .addGap(131) 112 | .addComponent(login, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE) 113 | .addContainerGap(137, Short.MAX_VALUE)) 114 | ); 115 | gl_contentPane.setVerticalGroup( 116 | gl_contentPane.createParallelGroup(Alignment.LEADING) 117 | .addGroup(gl_contentPane.createSequentialGroup() 118 | .addContainerGap() 119 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 122, GroupLayout.PREFERRED_SIZE) 120 | .addGap(47) 121 | .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE) 122 | .addComponent(loginUsername) 123 | .addComponent(username, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)) 124 | .addGap(41) 125 | .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE) 126 | .addComponent(loginPassword) 127 | .addComponent(password, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)) 128 | .addGap(37) 129 | .addComponent(login, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE) 130 | .addContainerGap(47, Short.MAX_VALUE)) 131 | ); 132 | 133 | JLabel loginpage = new JLabel("Login"); 134 | loginpage.setForeground(Color.BLACK); 135 | loginpage.setBounds(160, 47, 75, 27); 136 | desktopPane.add(loginpage); 137 | loginpage.setFont(new Font("Perpetua Titling MT", Font.BOLD, 22)); 138 | contentPane.setLayout(gl_contentPane); 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /StudentManagementSystem/Menu.java: -------------------------------------------------------------------------------- 1 | package StudentManagement; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.GroupLayout; 10 | import javax.swing.GroupLayout.Alignment; 11 | import javax.swing.JLabel; 12 | import javax.swing.JOptionPane; 13 | 14 | import java.awt.Font; 15 | import javax.swing.JSplitPane; 16 | import javax.swing.JDesktopPane; 17 | import javax.swing.JButton; 18 | import java.awt.event.ActionListener; 19 | import java.awt.event.ActionEvent; 20 | import java.awt.Color; 21 | 22 | public class Menu extends JFrame { 23 | 24 | private JPanel contentPane; 25 | 26 | 27 | public static void main(String[] args) { 28 | EventQueue.invokeLater(new Runnable() { 29 | public void run() { 30 | try { 31 | Menu frame = new Menu(); 32 | frame.setVisible(true); 33 | } catch (Exception e) { 34 | e.printStackTrace(); 35 | } 36 | } 37 | }); 38 | } 39 | 40 | 41 | public Menu() { 42 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 43 | setBounds(100, 100, 450, 623); 44 | contentPane = new JPanel(); 45 | contentPane.setBackground(Color.GRAY); 46 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 47 | setContentPane(contentPane); 48 | 49 | JDesktopPane desktopPane = new JDesktopPane(); 50 | desktopPane.setBackground(Color.LIGHT_GRAY); 51 | 52 | JDesktopPane desktopPane_1 = new JDesktopPane(); 53 | desktopPane_1.setBackground(Color.LIGHT_GRAY); 54 | GroupLayout gl_contentPane = new GroupLayout(contentPane); 55 | gl_contentPane.setHorizontalGroup( 56 | gl_contentPane.createParallelGroup(Alignment.LEADING) 57 | .addGroup(gl_contentPane.createSequentialGroup() 58 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 59 | .addGroup(gl_contentPane.createSequentialGroup() 60 | .addContainerGap() 61 | .addComponent(desktopPane_1, GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE)) 62 | .addGroup(gl_contentPane.createSequentialGroup() 63 | .addGap(36) 64 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 351, GroupLayout.PREFERRED_SIZE))) 65 | .addContainerGap()) 66 | ); 67 | gl_contentPane.setVerticalGroup( 68 | gl_contentPane.createParallelGroup(Alignment.LEADING) 69 | .addGroup(gl_contentPane.createSequentialGroup() 70 | .addContainerGap() 71 | .addComponent(desktopPane_1, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) 72 | .addGap(26) 73 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 445, GroupLayout.PREFERRED_SIZE) 74 | .addContainerGap(37, Short.MAX_VALUE)) 75 | ); 76 | 77 | JButton btnNewButton = new JButton("Add Student"); 78 | btnNewButton.setForeground(Color.BLACK); 79 | btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 16)); 80 | btnNewButton.addActionListener(new ActionListener() { 81 | public void actionPerformed(ActionEvent e) { 82 | 83 | Student studentDetails = new Student(); 84 | studentDetails.show(); 85 | dispose(); 86 | 87 | } 88 | }); 89 | btnNewButton.setBounds(32, 37, 287, 47); 90 | desktopPane.add(btnNewButton); 91 | 92 | JButton btnNewButton_1 = new JButton("Remove Existing Student"); 93 | btnNewButton_1.setForeground(Color.BLACK); 94 | btnNewButton_1.addActionListener(new ActionListener() { 95 | public void actionPerformed(ActionEvent e) { 96 | 97 | RemoveStudent remove = new RemoveStudent(); 98 | remove.show(); 99 | dispose(); 100 | 101 | } 102 | }); 103 | btnNewButton_1.setFont(new Font("Tahoma", Font.BOLD, 16)); 104 | btnNewButton_1.setBounds(32, 113, 287, 52); 105 | desktopPane.add(btnNewButton_1); 106 | 107 | JButton btnNewButton_2 = new JButton("View Students"); 108 | btnNewButton_2.setForeground(Color.BLACK); 109 | btnNewButton_2.addActionListener(new ActionListener() { 110 | public void actionPerformed(ActionEvent e) { 111 | 112 | ViewStudent viewStudent = new ViewStudent(); 113 | viewStudent.show(); 114 | dispose(); 115 | 116 | } 117 | }); 118 | btnNewButton_2.setFont(new Font("Tahoma", Font.BOLD, 16)); 119 | btnNewButton_2.setBounds(32, 195, 287, 52); 120 | desktopPane.add(btnNewButton_2); 121 | 122 | JButton btnNewButton_3 = new JButton("Update Existing Student"); 123 | btnNewButton_3.setForeground(Color.BLACK); 124 | btnNewButton_3.addActionListener(new ActionListener() { 125 | public void actionPerformed(ActionEvent e) { 126 | 127 | UpdateStudent updateStudent = new UpdateStudent(); 128 | updateStudent.show(); 129 | dispose(); 130 | 131 | } 132 | }); 133 | btnNewButton_3.setFont(new Font("Tahoma", Font.BOLD, 16)); 134 | btnNewButton_3.setBounds(32, 272, 287, 52); 135 | desktopPane.add(btnNewButton_3); 136 | 137 | JButton btnNewButton_4 = new JButton("Logout"); 138 | btnNewButton_4.setForeground(Color.BLACK); 139 | btnNewButton_4.addActionListener(new ActionListener() { 140 | public void actionPerformed(ActionEvent e) { 141 | 142 | Login logout = new Login(); 143 | logout.show(); 144 | dispose(); 145 | JOptionPane.showMessageDialog(null, "Successfully logged out :)"); 146 | } 147 | }); 148 | btnNewButton_4.setFont(new Font("Tahoma", Font.BOLD, 16)); 149 | btnNewButton_4.setBounds(32, 348, 287, 47); 150 | desktopPane.add(btnNewButton_4); 151 | 152 | JLabel lblNewLabel = new JLabel("What do you want ?"); 153 | lblNewLabel.setForeground(Color.BLACK); 154 | lblNewLabel.setBounds(93, 17, 220, 27); 155 | desktopPane_1.add(lblNewLabel); 156 | lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 22)); 157 | contentPane.setLayout(gl_contentPane); 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /StudentManagementSystem/RemoveStudent.java: -------------------------------------------------------------------------------- 1 | package StudentManagement; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.GroupLayout; 10 | import javax.swing.GroupLayout.Alignment; 11 | import javax.swing.JTextField; 12 | import javax.swing.JLabel; 13 | import javax.swing.JOptionPane; 14 | 15 | import java.awt.Font; 16 | import javax.swing.JButton; 17 | import javax.swing.JDesktopPane; 18 | import javax.swing.LayoutStyle.ComponentPlacement; 19 | import java.awt.Color; 20 | import java.awt.event.ActionListener; 21 | import java.sql.Connection; 22 | import java.sql.DriverManager; 23 | import java.sql.PreparedStatement; 24 | import java.sql.ResultSet; 25 | import java.sql.SQLException; 26 | import java.awt.event.ActionEvent; 27 | 28 | public class RemoveStudent extends JFrame { 29 | 30 | 31 | Connection con = null; 32 | PreparedStatement pst = null; 33 | ResultSet rs; 34 | 35 | private JPanel contentPane; 36 | private JTextField deleteEntry; 37 | 38 | 39 | public static void main(String[] args) { 40 | EventQueue.invokeLater(new Runnable() { 41 | public void run() { 42 | try { 43 | RemoveStudent frame = new RemoveStudent(); 44 | frame.setVisible(true); 45 | } catch (Exception e) { 46 | e.printStackTrace(); 47 | } 48 | } 49 | }); 50 | } 51 | 52 | 53 | public RemoveStudent() { 54 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 55 | setBounds(100, 100, 477, 526); 56 | contentPane = new JPanel(); 57 | contentPane.setBackground(Color.GRAY); 58 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 59 | setContentPane(contentPane); 60 | 61 | JDesktopPane desktopPane = new JDesktopPane(); 62 | desktopPane.setBackground(Color.LIGHT_GRAY); 63 | 64 | JDesktopPane desktopPane_1 = new JDesktopPane(); 65 | desktopPane_1.setBackground(Color.LIGHT_GRAY); 66 | GroupLayout gl_contentPane = new GroupLayout(contentPane); 67 | gl_contentPane.setHorizontalGroup( 68 | gl_contentPane.createParallelGroup(Alignment.LEADING) 69 | .addGroup(gl_contentPane.createSequentialGroup() 70 | .addContainerGap() 71 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 72 | .addComponent(desktopPane_1, GroupLayout.PREFERRED_SIZE, 433, GroupLayout.PREFERRED_SIZE) 73 | .addComponent(desktopPane, GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE)) 74 | .addContainerGap()) 75 | ); 76 | gl_contentPane.setVerticalGroup( 77 | gl_contentPane.createParallelGroup(Alignment.LEADING) 78 | .addGroup(gl_contentPane.createSequentialGroup() 79 | .addContainerGap() 80 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 203, GroupLayout.PREFERRED_SIZE) 81 | .addGap(18) 82 | .addComponent(desktopPane_1, GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE) 83 | .addContainerGap()) 84 | ); 85 | 86 | deleteEntry = new JTextField(); 87 | deleteEntry.setBounds(111, 40, 206, 29); 88 | desktopPane_1.add(deleteEntry); 89 | deleteEntry.setColumns(10); 90 | 91 | JButton deleteData = new JButton("Delete"); 92 | deleteData.addActionListener(new ActionListener() { 93 | public void actionPerformed(ActionEvent e) { 94 | 95 | 96 | 97 | 98 | try { 99 | String query = "DELETE FROM `student` WHERE entrynumber=?"; 100 | con = DriverManager.getConnection("jdbc:mysql://localhost/studentmanagementsystem", "root", ""); 101 | pst=con.prepareStatement(query); 102 | 103 | String pid = deleteEntry.getText(); 104 | 105 | pst.setString(1, pid); 106 | 107 | int k = pst.executeUpdate(); 108 | 109 | if(k==1) { 110 | JOptionPane.showMessageDialog(null, "Deleted Successfully :)"); 111 | dispose(); 112 | Menu menu = new Menu(); 113 | menu.show(); 114 | } 115 | 116 | } 117 | catch(Exception ex) { 118 | JOptionPane.showMessageDialog(null, ex); 119 | } 120 | 121 | 122 | 123 | 124 | } 125 | }); 126 | deleteData.setForeground(Color.BLACK); 127 | deleteData.setBounds(130, 111, 167, 37); 128 | desktopPane_1.add(deleteData); 129 | deleteData.setFont(new Font("Tahoma", Font.BOLD, 14)); 130 | 131 | JButton btnNewButton_1 = new JButton("Cancel"); 132 | btnNewButton_1.setForeground(Color.BLACK); 133 | btnNewButton_1.addActionListener(new ActionListener() { 134 | public void actionPerformed(ActionEvent e) { 135 | 136 | Menu menu = new Menu(); 137 | menu.show(); 138 | dispose(); 139 | 140 | } 141 | }); 142 | btnNewButton_1.setFont(new Font("Tahoma", Font.BOLD, 14)); 143 | btnNewButton_1.setBounds(130, 171, 167, 37); 144 | desktopPane_1.add(btnNewButton_1); 145 | 146 | JLabel lblNewLabel = new JLabel("Enter the \"Entry Number\" of the student"); 147 | lblNewLabel.setForeground(Color.BLACK); 148 | lblNewLabel.setBounds(10, 90, 408, 25); 149 | desktopPane.add(lblNewLabel); 150 | lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 20)); 151 | contentPane.setLayout(gl_contentPane); 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /StudentManagementSystem/Student.java: -------------------------------------------------------------------------------- 1 | package StudentManagement; 2 | 3 | import java.awt.EventQueue; 4 | import java.awt.Font; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.ActionListener; 7 | import java.sql.Connection; 8 | import java.sql.DriverManager; 9 | import java.sql.PreparedStatement; 10 | 11 | import javax.swing.GroupLayout; 12 | import javax.swing.GroupLayout.Alignment; 13 | import javax.swing.JButton; 14 | import javax.swing.JFrame; 15 | import javax.swing.JLabel; 16 | import javax.swing.JOptionPane; 17 | import javax.swing.JPanel; 18 | import javax.swing.JTextField; 19 | import javax.swing.LayoutStyle.ComponentPlacement; 20 | import javax.swing.border.EmptyBorder; 21 | import java.awt.Color; 22 | import javax.swing.JDesktopPane; 23 | 24 | public class Student extends JFrame { 25 | 26 | private JPanel contentPane; 27 | private JTextField sname; 28 | private JTextField sentry; 29 | private JTextField semail; 30 | private JTextField scontact; 31 | private JTextField shome; 32 | 33 | 34 | Connection con = null; 35 | PreparedStatement pst = null; 36 | 37 | 38 | public static void main(String[] args) { 39 | EventQueue.invokeLater(new Runnable() { 40 | public void run() { 41 | try { 42 | Student frame = new Student(); 43 | frame.setVisible(true); 44 | } catch (Exception e) { 45 | e.printStackTrace(); 46 | } 47 | } 48 | }); 49 | } 50 | 51 | 52 | public Student() { 53 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 54 | setBounds(100, 100, 588, 620); 55 | contentPane = new JPanel(); 56 | contentPane.setBackground(Color.LIGHT_GRAY); 57 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 58 | setContentPane(contentPane); 59 | 60 | JLabel studentDetails = new JLabel("Student Details"); 61 | studentDetails.setForeground(Color.BLACK); 62 | studentDetails.setFont(new Font("Perpetua Titling MT", Font.BOLD, 22)); 63 | 64 | JLabel studentName = new JLabel("Student Name"); 65 | studentName.setForeground(Color.BLACK); 66 | studentName.setFont(new Font("Perpetua Titling MT", Font.BOLD, 14)); 67 | 68 | JLabel entryNumber = new JLabel("Entry Number"); 69 | entryNumber.setForeground(Color.BLACK); 70 | entryNumber.setFont(new Font("Perpetua Titling MT", Font.BOLD, 14)); 71 | 72 | JLabel emailAddress = new JLabel("Email Address"); 73 | emailAddress.setForeground(Color.BLACK); 74 | emailAddress.setFont(new Font("Perpetua Titling MT", Font.BOLD, 14)); 75 | 76 | JLabel contactNumber = new JLabel("Contact Number"); 77 | contactNumber.setForeground(Color.BLACK); 78 | contactNumber.setFont(new Font("Perpetua Titling MT", Font.BOLD, 14)); 79 | 80 | sname = new JTextField(); 81 | sname.setColumns(10); 82 | 83 | sentry = new JTextField(); 84 | sentry.setColumns(10); 85 | 86 | semail = new JTextField(); 87 | semail.setColumns(10); 88 | 89 | scontact = new JTextField(); 90 | scontact.setColumns(10); 91 | 92 | JLabel homeCity = new JLabel("Home City"); 93 | homeCity.setForeground(Color.BLACK); 94 | homeCity.setFont(new Font("Perpetua Titling MT", Font.BOLD, 14)); 95 | 96 | JButton submit = new JButton("Submit"); 97 | submit.setForeground(Color.BLACK); 98 | submit.addActionListener(new ActionListener() { 99 | public void actionPerformed(ActionEvent e) { 100 | 101 | try { 102 | String query = "INSERT INTO `student`(`name`, `entrynumber`, `email`, `contactnumber`, `homecity`) VALUES (?, ?, ?, ?, ?)"; 103 | con = DriverManager.getConnection("jdbc:mysql://localhost/studentmanagementsystem", "root", ""); 104 | pst=con.prepareStatement(query); 105 | pst.setString(1, sname.getText()); 106 | pst.setString(2, sentry.getText()); 107 | pst.setString(3, semail.getText()); 108 | pst.setString(4, scontact.getText()); 109 | pst.setString(5, shome.getText()); 110 | if(sname.getText().equals("") || sentry.getText().equals("") || semail.getText().equals("") || scontact.getText().equals("") || shome.getText().equals("")) { 111 | JOptionPane.showMessageDialog(null, "Fill all the details :("); 112 | } 113 | else { 114 | pst.executeUpdate(); 115 | JOptionPane.showMessageDialog(null, "Student added Successfully :)"); 116 | dispose(); 117 | Menu menu = new Menu(); 118 | menu.show(); 119 | } 120 | } 121 | catch(Exception ex) { 122 | JOptionPane.showMessageDialog(null, ex); 123 | } 124 | 125 | } 126 | }); 127 | submit.setFont(new Font("Tahoma", Font.BOLD, 14)); 128 | 129 | shome = new JTextField(); 130 | shome.setColumns(10); 131 | 132 | JDesktopPane desktopPane = new JDesktopPane(); 133 | desktopPane.setBackground(Color.GRAY); 134 | 135 | JButton btnNewButton = new JButton("Cancel"); 136 | btnNewButton.setForeground(Color.BLACK); 137 | btnNewButton.addActionListener(new ActionListener() { 138 | public void actionPerformed(ActionEvent e) { 139 | Menu menu = new Menu(); 140 | menu.show(); 141 | dispose(); 142 | } 143 | }); 144 | btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 14)); 145 | 146 | JDesktopPane desktopPane_1 = new JDesktopPane(); 147 | desktopPane_1.setBackground(Color.GRAY); 148 | 149 | JDesktopPane desktopPane_2 = new JDesktopPane(); 150 | desktopPane_2.setBackground(Color.GRAY); 151 | 152 | JDesktopPane desktopPane_3 = new JDesktopPane(); 153 | desktopPane_3.setBackground(Color.GRAY); 154 | GroupLayout gl_contentPane = new GroupLayout(contentPane); 155 | gl_contentPane.setHorizontalGroup( 156 | gl_contentPane.createParallelGroup(Alignment.LEADING) 157 | .addComponent(desktopPane, GroupLayout.DEFAULT_SIZE, 573, Short.MAX_VALUE) 158 | .addGroup(gl_contentPane.createSequentialGroup() 159 | .addComponent(desktopPane_1, GroupLayout.PREFERRED_SIZE, 563, GroupLayout.PREFERRED_SIZE) 160 | .addContainerGap()) 161 | .addGroup(gl_contentPane.createSequentialGroup() 162 | .addComponent(desktopPane_2, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE) 163 | .addPreferredGap(ComponentPlacement.RELATED) 164 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 165 | .addGroup(gl_contentPane.createSequentialGroup() 166 | .addGap(43) 167 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 168 | .addComponent(entryNumber) 169 | .addComponent(studentName, GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE) 170 | .addComponent(emailAddress) 171 | .addComponent(contactNumber) 172 | .addComponent(homeCity)) 173 | .addPreferredGap(ComponentPlacement.RELATED) 174 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 175 | .addComponent(scontact, 242, 242, 242) 176 | .addComponent(shome, 247, 247, 247) 177 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false) 178 | .addComponent(semail) 179 | .addComponent(sname) 180 | .addComponent(sentry, GroupLayout.DEFAULT_SIZE, 240, Short.MAX_VALUE))) 181 | .addGap(34)) 182 | .addGroup(gl_contentPane.createSequentialGroup() 183 | .addPreferredGap(ComponentPlacement.RELATED, 125, Short.MAX_VALUE) 184 | .addComponent(studentDetails) 185 | .addGap(137)) 186 | .addGroup(gl_contentPane.createSequentialGroup() 187 | .addGap(119) 188 | .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING, false) 189 | .addComponent(btnNewButton, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 190 | .addComponent(submit, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)) 191 | .addGap(128))) 192 | .addPreferredGap(ComponentPlacement.RELATED) 193 | .addComponent(desktopPane_3, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) 194 | .addGap(18)) 195 | ); 196 | gl_contentPane.setVerticalGroup( 197 | gl_contentPane.createParallelGroup(Alignment.LEADING) 198 | .addGroup(gl_contentPane.createSequentialGroup() 199 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE) 200 | .addGap(11) 201 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 202 | .addGroup(gl_contentPane.createSequentialGroup() 203 | .addComponent(studentDetails) 204 | .addGap(18) 205 | .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE) 206 | .addComponent(studentName, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE) 207 | .addComponent(sname, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)) 208 | .addGap(28) 209 | .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE) 210 | .addComponent(sentry, GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE) 211 | .addComponent(entryNumber)) 212 | .addGap(41) 213 | .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE) 214 | .addComponent(semail, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE) 215 | .addComponent(emailAddress)) 216 | .addGap(37) 217 | .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE) 218 | .addComponent(contactNumber) 219 | .addComponent(scontact, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)) 220 | .addGap(41) 221 | .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE) 222 | .addComponent(shome, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE) 223 | .addComponent(homeCity)) 224 | .addGap(43) 225 | .addComponent(submit, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE) 226 | .addGap(18) 227 | .addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)) 228 | .addGroup(gl_contentPane.createSequentialGroup() 229 | .addPreferredGap(ComponentPlacement.RELATED) 230 | .addComponent(desktopPane_2, GroupLayout.PREFERRED_SIZE, 506, GroupLayout.PREFERRED_SIZE)) 231 | .addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup() 232 | .addPreferredGap(ComponentPlacement.UNRELATED) 233 | .addComponent(desktopPane_3, GroupLayout.PREFERRED_SIZE, 506, GroupLayout.PREFERRED_SIZE) 234 | .addPreferredGap(ComponentPlacement.RELATED))) 235 | .addGap(13) 236 | .addComponent(desktopPane_1, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) 237 | .addGap(6)) 238 | ); 239 | contentPane.setLayout(gl_contentPane); 240 | } 241 | 242 | } 243 | -------------------------------------------------------------------------------- /StudentManagementSystem/UpdateStudent.java: -------------------------------------------------------------------------------- 1 | package StudentManagement; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.GroupLayout; 10 | import javax.swing.GroupLayout.Alignment; 11 | import javax.swing.JDesktopPane; 12 | import javax.swing.JTextField; 13 | import javax.swing.JButton; 14 | import java.awt.Font; 15 | import javax.swing.JLabel; 16 | import javax.swing.JOptionPane; 17 | 18 | import java.awt.event.ActionListener; 19 | import java.sql.Connection; 20 | import java.sql.DriverManager; 21 | import java.sql.PreparedStatement; 22 | import java.sql.ResultSet; 23 | import java.sql.SQLException; 24 | import java.awt.event.ActionEvent; 25 | import javax.swing.LayoutStyle.ComponentPlacement; 26 | import java.awt.Color; 27 | 28 | public class UpdateStudent extends JFrame { 29 | 30 | Connection con = null; 31 | PreparedStatement pst = null; 32 | ResultSet rs; 33 | 34 | private JPanel contentPane; 35 | private JTextField updateEntry; 36 | private JTextField nameU; 37 | private JTextField entryU; 38 | private JTextField emailU; 39 | private JTextField contactU; 40 | private JTextField homeU; 41 | 42 | public static void main(String[] args) { 43 | EventQueue.invokeLater(new Runnable() { 44 | public void run() { 45 | try { 46 | UpdateStudent frame = new UpdateStudent(); 47 | frame.setVisible(true); 48 | } catch (Exception e) { 49 | e.printStackTrace(); 50 | } 51 | } 52 | }); 53 | } 54 | 55 | public UpdateStudent() { 56 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 57 | setBounds(100, 100, 676, 656); 58 | contentPane = new JPanel(); 59 | contentPane.setBackground(Color.LIGHT_GRAY); 60 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 61 | setContentPane(contentPane); 62 | 63 | JDesktopPane desktopPane = new JDesktopPane(); 64 | desktopPane.setBackground(Color.GRAY); 65 | 66 | nameU = new JTextField(); 67 | nameU.setColumns(10); 68 | 69 | JLabel lblNewLabel_1 = new JLabel("Student Name"); 70 | lblNewLabel_1.setForeground(Color.BLACK); 71 | lblNewLabel_1.setFont(new Font("Tahoma", Font.BOLD, 16)); 72 | 73 | JLabel lblNewLabel_1_1 = new JLabel("Entry Number"); 74 | lblNewLabel_1_1.setForeground(Color.BLACK); 75 | lblNewLabel_1_1.setFont(new Font("Tahoma", Font.BOLD, 16)); 76 | 77 | JLabel lblNewLabel_1_2 = new JLabel("Email Address"); 78 | lblNewLabel_1_2.setForeground(Color.BLACK); 79 | lblNewLabel_1_2.setFont(new Font("Tahoma", Font.BOLD, 16)); 80 | 81 | JLabel lblNewLabel_1_3 = new JLabel("Contact Number"); 82 | lblNewLabel_1_3.setForeground(Color.BLACK); 83 | lblNewLabel_1_3.setFont(new Font("Tahoma", Font.BOLD, 16)); 84 | 85 | JLabel lblNewLabel_1_4 = new JLabel("Home City"); 86 | lblNewLabel_1_4.setForeground(Color.BLACK); 87 | lblNewLabel_1_4.setFont(new Font("Tahoma", Font.BOLD, 16)); 88 | 89 | entryU = new JTextField(); 90 | entryU.setColumns(10); 91 | 92 | emailU = new JTextField(); 93 | emailU.setColumns(10); 94 | 95 | contactU = new JTextField(); 96 | contactU.setColumns(10); 97 | 98 | homeU = new JTextField(); 99 | homeU.setColumns(10); 100 | 101 | JButton updateBtn = new JButton("Update"); 102 | updateBtn.addActionListener(new ActionListener() { 103 | public void actionPerformed(ActionEvent e) { 104 | 105 | 106 | 107 | 108 | try { 109 | String query = "UPDATE `student` SET name=?, entrynumber=?, email=?, contactnumber=?, homecity=? WHERE entrynumber=?"; 110 | con = DriverManager.getConnection("jdbc:mysql://localhost/studentmanagementsystem", "root", ""); 111 | pst=con.prepareStatement(query); 112 | 113 | String pid = updateEntry.getText(); 114 | pst.setString(1, nameU.getText()); 115 | pst.setString(2, entryU.getText()); 116 | pst.setString(3, emailU.getText()); 117 | pst.setString(4, contactU.getText()); 118 | pst.setString(5, homeU.getText()); 119 | pst.setString(6, pid); 120 | if(nameU.getText().equals("") || entryU.getText().equals("") || emailU.getText().equals("") || contactU.getText().equals("") || homeU.getText().equals("")) { 121 | JOptionPane.showMessageDialog(null, "Fill all the details :("); 122 | } 123 | else { 124 | pst.executeUpdate(); 125 | JOptionPane.showMessageDialog(null, "Updated Successfully :)"); 126 | dispose(); 127 | Menu menu = new Menu(); 128 | menu.show(); 129 | } 130 | } 131 | catch(Exception ex) { 132 | JOptionPane.showMessageDialog(null, ex); 133 | } 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | } 142 | }); 143 | updateBtn.setForeground(Color.BLACK); 144 | updateBtn.setFont(new Font("Tahoma", Font.BOLD, 14)); 145 | GroupLayout gl_contentPane = new GroupLayout(contentPane); 146 | gl_contentPane.setHorizontalGroup( 147 | gl_contentPane.createParallelGroup(Alignment.LEADING) 148 | .addGroup(gl_contentPane.createSequentialGroup() 149 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 647, GroupLayout.PREFERRED_SIZE) 150 | .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 151 | .addGroup(gl_contentPane.createSequentialGroup() 152 | .addGap(127) 153 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 154 | .addGroup(gl_contentPane.createSequentialGroup() 155 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 156 | .addComponent(lblNewLabel_1) 157 | .addGroup(gl_contentPane.createSequentialGroup() 158 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 159 | .addComponent(lblNewLabel_1_3, GroupLayout.PREFERRED_SIZE, 140, GroupLayout.PREFERRED_SIZE) 160 | .addComponent(lblNewLabel_1_2, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE) 161 | .addComponent(lblNewLabel_1_1, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)) 162 | .addPreferredGap(ComponentPlacement.RELATED, 383, Short.MAX_VALUE))) 163 | .addGap(22)) 164 | .addGroup(gl_contentPane.createSequentialGroup() 165 | .addComponent(lblNewLabel_1_4, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE) 166 | .addPreferredGap(ComponentPlacement.RELATED))) 167 | .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) 168 | .addComponent(entryU, GroupLayout.PREFERRED_SIZE, 207, GroupLayout.PREFERRED_SIZE) 169 | .addComponent(nameU, GroupLayout.PREFERRED_SIZE, 207, GroupLayout.PREFERRED_SIZE) 170 | .addComponent(emailU, GroupLayout.PREFERRED_SIZE, 207, GroupLayout.PREFERRED_SIZE) 171 | .addComponent(contactU, GroupLayout.PREFERRED_SIZE, 207, GroupLayout.PREFERRED_SIZE) 172 | .addComponent(homeU, GroupLayout.PREFERRED_SIZE, 207, GroupLayout.PREFERRED_SIZE)) 173 | .addGap(114)) 174 | .addGroup(gl_contentPane.createSequentialGroup() 175 | .addGap(261) 176 | .addComponent(updateBtn, GroupLayout.PREFERRED_SIZE, 128, GroupLayout.PREFERRED_SIZE) 177 | .addContainerGap(261, Short.MAX_VALUE)) 178 | ); 179 | gl_contentPane.setVerticalGroup( 180 | gl_contentPane.createParallelGroup(Alignment.LEADING) 181 | .addGroup(gl_contentPane.createSequentialGroup() 182 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 242, GroupLayout.PREFERRED_SIZE) 183 | .addGap(27) 184 | .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING) 185 | .addComponent(lblNewLabel_1) 186 | .addComponent(nameU, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)) 187 | .addGap(27) 188 | .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING) 189 | .addComponent(lblNewLabel_1_1, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE) 190 | .addComponent(entryU, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)) 191 | .addGap(26) 192 | .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING) 193 | .addComponent(lblNewLabel_1_2, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE) 194 | .addComponent(emailU, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)) 195 | .addGap(29) 196 | .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING) 197 | .addComponent(lblNewLabel_1_3, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE) 198 | .addComponent(contactU, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)) 199 | .addGap(27) 200 | .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING) 201 | .addComponent(homeU, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE) 202 | .addComponent(lblNewLabel_1_4, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)) 203 | .addPreferredGap(ComponentPlacement.RELATED, 27, Short.MAX_VALUE) 204 | .addComponent(updateBtn, GroupLayout.PREFERRED_SIZE, 36, GroupLayout.PREFERRED_SIZE) 205 | .addContainerGap()) 206 | ); 207 | 208 | updateEntry = new JTextField(); 209 | updateEntry.setBounds(190, 100, 237, 33); 210 | desktopPane.add(updateEntry); 211 | updateEntry.setColumns(10); 212 | 213 | JButton btnNewButton = new JButton("Search"); 214 | btnNewButton.setForeground(Color.BLACK); 215 | btnNewButton.addActionListener(new ActionListener() { 216 | public void actionPerformed(ActionEvent e) { 217 | 218 | String str = updateEntry.getText(); 219 | 220 | try { 221 | con = DriverManager.getConnection("jdbc:mysql://localhost/studentmanagementsystem", "root", ""); 222 | pst = con.prepareStatement("SELECT * FROM student where entrynumber = ?"); 223 | pst.setString(1, str); 224 | rs = pst.executeQuery(); 225 | if(rs.next()==true) { 226 | String s = rs.getString(1); 227 | String s1 = rs.getString(2); 228 | String s2 = rs.getString(3); 229 | String s3 = rs.getString(4); 230 | String s4 = rs.getString(5); 231 | 232 | nameU.setText(s); 233 | entryU.setText(s1); 234 | emailU.setText(s2); 235 | contactU.setText(s3); 236 | homeU.setText(s4); 237 | } 238 | 239 | } 240 | catch (SQLException e1) { 241 | e1.printStackTrace(); 242 | } 243 | 244 | } 245 | }); 246 | btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 14)); 247 | btnNewButton.setBounds(334, 164, 149, 33); 248 | desktopPane.add(btnNewButton); 249 | 250 | JButton btnCancel = new JButton("Cancel"); 251 | btnCancel.setForeground(Color.BLACK); 252 | btnCancel.addActionListener(new ActionListener() { 253 | public void actionPerformed(ActionEvent e) { 254 | Menu menu = new Menu(); 255 | menu.show(); 256 | dispose(); 257 | } 258 | }); 259 | btnCancel.setFont(new Font("Tahoma", Font.BOLD, 14)); 260 | btnCancel.setBounds(143, 164, 149, 33); 261 | desktopPane.add(btnCancel); 262 | 263 | JLabel lblNewLabel = new JLabel("Search the \"Entry Number\""); 264 | lblNewLabel.setForeground(Color.BLACK); 265 | lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 20)); 266 | lblNewLabel.setBounds(180, 56, 283, 33); 267 | desktopPane.add(lblNewLabel); 268 | contentPane.setLayout(gl_contentPane); 269 | } 270 | } 271 | -------------------------------------------------------------------------------- /StudentManagementSystem/ViewStudent.java: -------------------------------------------------------------------------------- 1 | package StudentManagement; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.GroupLayout; 10 | import javax.swing.GroupLayout.Alignment; 11 | import javax.swing.JDesktopPane; 12 | import javax.swing.JLabel; 13 | import java.awt.Font; 14 | import java.awt.Color; 15 | import javax.swing.JButton; 16 | import java.awt.event.ActionListener; 17 | import java.awt.event.ActionEvent; 18 | 19 | public class ViewStudent extends JFrame { 20 | 21 | private JPanel contentPane; 22 | 23 | public static void main(String[] args) { 24 | EventQueue.invokeLater(new Runnable() { 25 | public void run() { 26 | try { 27 | ViewStudent frame = new ViewStudent(); 28 | frame.setVisible(true); 29 | } catch (Exception e) { 30 | e.printStackTrace(); 31 | } 32 | } 33 | }); 34 | } 35 | 36 | public ViewStudent() { 37 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 38 | setBounds(100, 100, 782, 611); 39 | contentPane = new JPanel(); 40 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 41 | setContentPane(contentPane); 42 | 43 | JDesktopPane desktopPane = new JDesktopPane(); 44 | desktopPane.setBackground(Color.GRAY); 45 | GroupLayout gl_contentPane = new GroupLayout(contentPane); 46 | gl_contentPane.setHorizontalGroup( 47 | gl_contentPane.createParallelGroup(Alignment.LEADING) 48 | .addGroup(gl_contentPane.createSequentialGroup() 49 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 753, GroupLayout.PREFERRED_SIZE) 50 | .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 51 | ); 52 | gl_contentPane.setVerticalGroup( 53 | gl_contentPane.createParallelGroup(Alignment.LEADING) 54 | .addGroup(gl_contentPane.createSequentialGroup() 55 | .addComponent(desktopPane, GroupLayout.PREFERRED_SIZE, 139, GroupLayout.PREFERRED_SIZE) 56 | .addContainerGap(423, Short.MAX_VALUE)) 57 | ); 58 | 59 | JLabel lblNewLabel = new JLabel("Student Details"); 60 | lblNewLabel.setForeground(Color.BLACK); 61 | lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 28)); 62 | lblNewLabel.setBounds(255, 27, 225, 52); 63 | desktopPane.add(lblNewLabel); 64 | 65 | JButton btnNewButton = new JButton("Go Back"); 66 | btnNewButton.setForeground(Color.BLACK); 67 | btnNewButton.addActionListener(new ActionListener() { 68 | public void actionPerformed(ActionEvent e) { 69 | Menu menu = new Menu(); 70 | menu.show(); 71 | dispose(); 72 | } 73 | }); 74 | btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 14)); 75 | btnNewButton.setBounds(10, 96, 113, 32); 76 | desktopPane.add(btnNewButton); 77 | contentPane.setLayout(gl_contentPane); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /StudentManagementSystem/mysql-connector-java-8.0.27.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaigora24/Student-Management-System/286683d32ebeba2e604bd5751a0f4cfa8719f54c/StudentManagementSystem/mysql-connector-java-8.0.27.jar -------------------------------------------------------------------------------- /StudentManagementSystem/student.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 5.1.1 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Host: 127.0.0.1 6 | -- Generation Time: Feb 13, 2022 at 07:28 PM 7 | -- Server version: 10.4.21-MariaDB 8 | -- PHP Version: 8.0.12 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | START TRANSACTION; 12 | SET time_zone = "+00:00"; 13 | 14 | 15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 18 | /*!40101 SET NAMES utf8mb4 */; 19 | 20 | -- 21 | -- Database: `studentmanagementsystem` 22 | -- 23 | 24 | -- -------------------------------------------------------- 25 | 26 | -- 27 | -- Table structure for table `student` 28 | -- 29 | 30 | CREATE TABLE `student` ( 31 | `name` varchar(50) NOT NULL, 32 | `entrynumber` varchar(50) NOT NULL, 33 | `email` varchar(50) NOT NULL, 34 | `contactnumber` varchar(15) NOT NULL, 35 | `homecity` varchar(50) NOT NULL 36 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 37 | 38 | -- 39 | -- Dumping data for table `student` 40 | -- 41 | 42 | INSERT INTO `student` (`name`, `entrynumber`, `email`, `contactnumber`, `homecity`) VALUES 43 | ('Divyankar Jha', '19bec022', '19bec022@smvdu.ac.in', '9876543210', 'Faridabad'), 44 | ('Ishu Sharma', '19bec031', '19bec031@smvdu.ac.in', '9876543210', 'Amritsar'), 45 | ('Jai Gora', '19bec033', '19bec033@smvdu.ac.in', '9876543210', 'Rohtak'), 46 | ('Manik Shama', '19bec046', '19bec046@smvdu.ac.in', '9876543210', 'Jammu'), 47 | ('Naishadh', '19bec050', '19bec050@smvdu.ac.in', '9876543210', 'New Delhi'); 48 | COMMIT; 49 | 50 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 51 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 52 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 53 | -------------------------------------------------------------------------------- /images/addStudent.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaigora24/Student-Management-System/286683d32ebeba2e604bd5751a0f4cfa8719f54c/images/addStudent.PNG -------------------------------------------------------------------------------- /images/deleteStudent.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaigora24/Student-Management-System/286683d32ebeba2e604bd5751a0f4cfa8719f54c/images/deleteStudent.PNG -------------------------------------------------------------------------------- /images/login.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaigora24/Student-Management-System/286683d32ebeba2e604bd5751a0f4cfa8719f54c/images/login.PNG -------------------------------------------------------------------------------- /images/menu.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaigora24/Student-Management-System/286683d32ebeba2e604bd5751a0f4cfa8719f54c/images/menu.PNG -------------------------------------------------------------------------------- /images/updateStudent.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaigora24/Student-Management-System/286683d32ebeba2e604bd5751a0f4cfa8719f54c/images/updateStudent.PNG --------------------------------------------------------------------------------