0% found this document useful (0 votes)
8 views9 pages

Omkar Ajp

AJPproject
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)
8 views9 pages

Omkar Ajp

AJPproject
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/ 9

ONLINE DRAWING BOARD

Introduction:

The Student Management System using AWT, Swing, and


event handling is a Java-based application that offers a
graphical user interface for managing student records. This
system is designed to simplify the management of student
information, making it easy for educational institutions or
administrators to add, display, and search for student
details.

With this system, users can input student data, such as ID,
name, and age, and then perform various operations on this
data, including adding new student records, displaying
existing records, and searching for specific students by
their ID. The graphical user interface (GUI) is built using
Java's AWT and Swing libraries, providing a user-friendly
environment for interaction.
The key features of this Student Management System
include:

l. Add Student Records: Users can input and save


information for new students, which includes their
unique ID, name, and age.

1. Display Students: The system allows users to view a


list of all the students in the system, providing an
overview of the registered student records.
ONLINE DRAWING BOARD

Code:-

import
javax.swing.*;
import java.awt.*;
import
java.awt.event.ActionEvent;
import
java.awt.event.ActionListener;
import java.util.ArrayList;

public class
StudentManagementSystem {
private JFrame frame;
private JTextField
nameField; private
JTextField idField; private
JTextArea displayArea;
private ArrayList<Student> students;

public static void main(String[] args) {


StudentManagementSystem system = new
StudentManagementSystem(); system.initialize();
}

public void initialize() {


frame = new JFrame("Student Management System");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 300);

students = new ArrayList<>();

JPanel panel = new


JPanel();
frame.add(panel);

JLabel nameLabel = new


JLabel("Name:"); nameField = new
JTextField(20);

JLabel idLabel = new


JLabel("ID:"); idField = new
JTextField(10);

JButton addButton = new JButton("Add Student");


addButton.addActionListener(new ActionListener() {
@Override
ONLINE DRAWING BOARD

public void actionPerformed(ActionEvent


e) { addStudent();
}
});

JButton viewButton = new JButton("View Students");


viewButton.addActionListener(new ActionListener() {
6|P age
ONLINE DRAWING BOARD

@Override
public void actionPerformed(ActionEvent
e) { viewStudents();
}
});

JButton deleteButton = new JButton("Delete


Student"); deleteButton.addActionListener(new
ActionListener() {
@Override
public void actionPerformed(ActionEvent
e) { deleteStudent();
}
});

displayArea = new JTextArea(10,


30);
displayArea.setEditable(false);

panel.add(nameLabel);
panel.add(nameField);
panel.add(idLabel);
panel.add(idField);
panel.add(addButton);
panel.add(viewButton);
panel.add(deleteButton
);
panel.add(displayArea)
;

frame.setVisible(true);
}

private void addStudent() {


String name =
nameField.getText(); String id =
idField.getText();
students.add(new Student(name,
id)); nameField.setText("");
idField.setText("");
displayArea.setText("Student added:\n" + "Name: " + name + "\nID: "
+ id + "\n");
}

private void viewStudents() {


displayArea.setText("List of Students:\
n"); for (Student student : students) {
displayArea.append("Name: " + student.getName() + "\
nID: " + student.getId() + "\n");
ONLINE DRAWING BOARD

7|P age
ONLINE DRAWING BOARD

private void deleteStudent() {


String id =
idField.getText();
for (Student student : students) {
if
(student.getId().equals(id
)) {
students.remove(student);
displayArea.setText("Student with ID " + id + " has
been
deleted.");
return;
}
}
displayArea.setText("No student found with ID " + id);
}

private class Student


{ private String
name; private
String id;

public Student(String name, String


id) { this.name = name;
this.id = id;
}

public String
getName() { return
name;
}

public String getId()


ONLINE DRAWING BOARD

Output:

8|P age
ONLINE DRAWING BOARD

VVIT, 8
PAL
ONLINE DRAWING BOARD

ANEEXURE l
Evaluation Sheet for the Micro Project
Academic Year: 2023-24. Name of the
Faculty: Course: AJP Course Code: 22517

Semester: V Title of the Project:

Student Mangement System


Cos address by Micro Project:
A: Develops programs using GUI Framework(AWT & Swing).
B: Handle events of AWT and Swing components.
C: Develop programs to handle events in Java programming.
1) WAPt demonstrate use of components like
Label,TextField,TextArea,Button,Checkbox,RadioButton.
2)WAP to design a form using the components List and Choice .
.
1) Develop GUI programs using AWT components for given problem.
2) Create Frame window with specified AWT components.
3) Develop GUI programs using AWT components for given problem.
4) Use delegation event model to develop event driven program for the given
problem

Roll Student Name Marks out of for Marks out of for Total out
No. performance in group performance in of 10
activity oral/presentation
(D5 Col.8) (D5 Col.9)

(Signature of Faculty)

VVIT, 9
PAL

You might also like