StudentCGPATracker is a GUI-based application for students to login, view their details, and CGPA and SGPA.
Certainly! Let's go through the code in detail and explain each part:
//1 import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.TitledBorder; import java.awt.Color; import javax.swing.JLabel; import javax.swing.JOptionPane; import java.awt.Font; import javax.swing.JComboBox; import javax.swing.JButton; import javax.swing.JTextField; import javax.swing.JPasswordField; import javax.swing.SwingConstants; import java.awt.event.ActionListener; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.awt.event.ActionEvent;//2 public class Std_Login_Home { // Variables for post, sem1, and sem2 // ... public void post() { JOptionPane.showMessageDialog(null, "Notification : " + post); }
//3 private JFrame frame; private JTextField btnId; private JPasswordField btnPassword; private JTextField btnName; private JTextField btnRoll; private JTextField btnBranch; private JTextField btnSection; private JButton btnlogout; private JTextField cgpa; private JTextField sgpa; private JComboBox comboBox;//4 public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Std_Login_Home window = new Std_Login_Home(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); }
//5 private void initialize() { frame = new JFrame(); frame.getContentPane().setBackground(new Color(128, 128, 128)); frame.getContentPane().setForeground(new Color(128, 128, 128)); frame.setBounds(100, 100, 822, 511); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null);
//6 JPanel panel = new JPanel(); panel.setBorder(new TitledBorder(null, "Student_Details", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel.setBounds(10, 162, 791, 305); frame.getContentPane().add(panel); panel.setLayout(null);
//7 JPanel panel_1 = new JPanel(); panel_1.setBorder(new TitledBorder(null, "CGPA", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_1.setBounds(396, 11, 385, 283); panel.add(panel_1); panel_1.setLayout(null);//8 JLabel lblCgpa = new JLabel("CGPA"); lblCgpa.setFont(new Font("Tahoma", Font.BOLD, 20)); lblCgpa.setBounds(21, 35, 136, 25); panel_1.add(lblCgpa);
//9 // Similar code for other labels, text fields, and combo boxes... //10 JButton btnlog = new JButton("Login"); btnlog.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Code for handling login button click } }); //11 JButton btnlogout = new JButton("Logout"); btnlogout.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Code for handling logout button click } }); //12 // Code for handling database connectivity and fetching student details //13 // Code for CGPA calculation and display //14 // Code for handling logout and clearing displayed information
Detail Code:
That's a detailed explanation of the code! It covers the initialization of GUI components, handling login/logout, fetching student details from the database, calculating CGPA, and updating the GUI accordingly.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This project is a Java Swing-based student login system that allows students to access their details and calculate their CGPA (Cumulative Grade Point Average). The system includes the following features:
Overall, this project provides a basic student login system with the functionality to view student details and calculate the CGPA. It can serve as a starting point for further development and expansion based on specific requirements.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
MySql
I am using the above tables in SQL for this project.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
=> After completing the project, I will establish a connection between the SQL database and the Java GUI application using JDBC, resulting in a fully functional system.
Before Login -> Application
After Login -> Application
SGPA CHECKING
SGPA
LOGOUT -> APPLICATION
Attempting to log in without providing login credentials will result in an authentication error, as the system requires valid credentials for successful login.
Submitted by K SYAM PRASAD (Syampk58)
Download packets of source code on Coders Packet
Comments
Nice Work.
This project is useful for us.
Nice project...it is very useful for students.