1. Trang chủ
  2. » Luận Văn - Báo Cáo

Assignment PROG191 Java Programming Distinction

160 2 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Assignment 1 Front Sheet
Tác giả Tran Duc Long
Người hướng dẫn Dinh Duc Manh
Trường học Btec Level 5 Hnd Diploma in Computing
Chuyên ngành Computing
Thể loại assignment
Năm xuất bản 2023
Định dạng
Số trang 160
Dung lượng 6,78 MB

Cấu trúc

  • I. Introduction (11)
  • II. Requirement (11)
  • III. UI design (13)
    • 1. Login and Register (13)
    • 2. Wireframe Homepage (13)
  • IV. Implementation (17)
    • 1. Program structure (17)
    • 2. Classes (19)
      • 2.1. Package exception (19)
      • 2.2. Package model (28)
      • 2.3. Package controller.sort (46)
      • 2.4. Package controller (51)
        • 2.4.1 InforFilter (51)
        • 2.4.2 InforFilterImp (51)
        • 2.4.3 DataController (56)
        • 2.4.4 DataControllerImp (57)
      • 2.5. Package view (68)
    • 3. Important algorithms (100)
    • 4. How to handle errors (103)
      • 4.1. Error when user entered wrong input data (103)
      • 4.2. Error when saving file (105)
      • 4.3. Error when connect xampp (107)
  • V. Test (108)
    • 1. Test Junit (108)
    • 2. Test plan (116)
    • 3. Testing result (118)
    • 4. Solution (146)
  • VI. Screenshots of running program (148)
    • 1. Sign up (148)
    • 2. Login (148)
    • 3. Tab subject (149)
      • 3.1. Add subject (150)
      • 3.2. Edit subject (151)
    • 4. Tab student (152)
      • 4.1. Add student (153)
      • 4.2. Edit student (154)
    • 5. Tab register (155)
      • 5.1. Add register (156)
    • 6. Tab class division (157)
  • VII. Conclusion (158)

Nội dung

This exercise hits the mark in java swing programming. This exercise presents a course registration software for students. There is exception handling, strict error handling constraints, file reading and database connection.

Introduction

I was tasked with developing an app to address a problem faced by small businesses Specifically, the app aims to assist teachers in effectively managing students and subjects of Greenwich in a straightforward and user-friendly manner By doing so, it enables them to organize classes for students based on individual subjects, thus resolving the challenges of providing up-to-date information on subjects and class schedules to students Consequently, I have created a compact project named "Course Enrollment Management System." In this program, I employ a graphical user interface that incorporates the basic functionalities of Create, Read, Update, and Delete Additionally, I have implemented advanced features like search and sort to enhance the application's functionality To store and retrieve data, I utilize both file operations and a MySQL database To ensure a smooth user experience, I have implemented data validation techniques that generate custom exceptions to handle errors Lastly, I have employed JUnit Test to thoroughly examine all the primary functions of the registering course management program for Greenwich Viet Nam.

Requirement

Based on the problem statement provided earlier, the key features of my project are as follows:

• The application must possess an intuitive and user-friendly interface design

• Users should be able to input information conveniently through the use of forms

• User can register an account with Email and Password (Email must have the extension @fpt.edu.vn)

• User login with registered user information

• In the main interface of the application I divided into 4 tabs: Subject, Student, Register and Class Division a Tab Subjects o The program allows adding Subjects to the table o The program allows users to view all Subjects information that has been added to the table o The program allows users to update all information (except ID) of any Subjects

Page 12 of 159 o The program allows users to delete all fields on the form that they have filled out because of incorrect input to re-fill o The program allows users to search for subjects information by approximate name o The program allows users to search for subject information by number of lessons o The program allows users to sort subjects by name from a-z and z-a o The program allows users to sort subjects by number of lesson in ASC order and DESC order b Tab Students o The program allows adding Students to the table o The program allows users to view all Students information that has been added to the table o The program allows users to update all information (except ID) of any Students o The program allows users to delete all fields on the form that they have filled out because of incorrect input to re-fill o The program allows users to search for students information by approximate name o The program allows users to search for students information by id o The program allows users to search for students information by major o The program allows users to sort students by name from a-z and z-a o The program allows users to sort subjects by id c Tab Registerings o The program allows adding Registerings to the table o The program allows users to view all Registerings information that has been added to the table o The program allows users to update all information (except ID) of any Registerings o The program allows users to delete all fields on the form that they have filled out because of incorrect input to re-fill o The program allows users to search for Registerings information by approximate name o The program allows users to search for Registerings information by Student's name o The program allows users to search for Registerings information by subscription time

Page 13 of 159 o The program allows users to sort Registerings by student's name from a-z and z-a o The program allows users to sort Registerings by Early-late and Late-early registration time d Tab Class division o The program allows to create classes with data taken from the subject registration table, student information and subject information

In order to fulfill the requirements mentioned above, I have decided to utilize Netbean tool as the development platform and employ the Java language along with Java Swing This choice enables me to create high-quality solutions that align with the school's standards.

UI design

Login and Register

Users must register an account by email with the extension @fpt.edu.vn After registration is complete, users can log in with the previously registered account to access the system

Figure 1: Wireframe Sign up and login

Wireframe Homepage

Page 14 of 159 a Subject After entering the system, the user will see the subject management section:

Figure 2: Wirfeframe tab Subject b Student The student tab is located next to the Subject section When the user clicks on the student item, program will switch to the student management form

Figure 3: Wireframe tab student c Register The register tab is located next to the Student section When the user clicks on the register item, program will switch to the register management form

Figure 4: Wireframe tab register d Class division The Class division tab is located next to the Register section When the user clicks on the Class division item, program will switch to the create Course form

Figure 5: Wireframe tab Class division

Implementation

Program structure

The diagram provided illustrates the architecture of my Java application developed with the assistance of netbean coding tools I have employed the MVC (Model-View-Controller) pattern to ensure efficient code management and establish a logical flow of data within the program This approach enables a cohesive execution of the program's functionalities

I divided the program into 5 main packages: model, view, controller, controller.sort and exception The package model will contain classes that display data such as account, course, person, student, registering, and subject

Package View will be the place to display the user interface including the main form of the program The Package Controller will be the place to control the flow of data, like the brain of the program, including the interfaces and the classes that implement them Package controller.sort which contains sort classes according to each criterion related to subject, student, register Package exception is used to make exceptions defined by myself to validate the input data of the program in accordance with the desired form of FPT

By adopting the segregation of code across the three levels, the process of dividing and organizing the logic of web applications becomes remarkably straightforward, especially for managing large-scale projects involving sizable developer teams The primary advantage of employing such coding practices is the facilitation of rapid identification of specific code sections and seamless incorporation of new functionalities

The utilization of the MVC methodology greatly simplifies the modification of the entire application In the MVC pattern, the addition or updating of new views is streamlined due to the independence of each section

Consequently, any changes made to a particular section of the application do not impact the entire architecture This aspect enhances the flexibility and scalability of my application, as it enables seamless adaptation and expansion without disrupting the overall structure

Classes

The successful production of a final product relies on how different classes are organized and how each class approaches a task Here is a list of all the classes included in the program

The above code defines a custom class named InvalidPersonIdException which extends from the Exception class in Java This class was created to represent a special exception to be used when an error occurs with an invalid person ID

The InvalidPersonIdException class has two properties: invalidId: A string (String) representing an invalid person ID

The InvalidPersonIdException class provides the following methods:

InvalidPersonIdException(): Default constructor with no parameters

InvalidPersonIdException(String invalidId, String message): The constructor takes two parameters, one is invalidId representing the invalid person ID and the other is a message representing the message of the exception getInvalidId(): The method returns the value of the invalidId property setInvalidId(String invalidId): The method that assigns a value to the invalidId property

The InvalidPersonIdException class is designed to be thrown when an error occurs involving an invalid person ID With the extension from the Exception class, it can be handled by try-catch blocks or further thrown up to be handled at a higher level in the program structure The details of this exception class will be implemented by me in the controller and used in the view b InvalidStudentIdException

The given code defines a custom class called InvalidStudentIdException that extends the Exception class in Java This class is created to represent a specific exception that occurs when an invalid student ID is encountered

The InvalidStudentIdException class has one private attribute: invalidStudentId: A string that represents the invalid student ID

The InvalidStudentIdException class provides the following methods:

InvalidStudentIdException(): A default constructor without any parameters

InvalidStudentIdException(String invalidStudentId, String message): A constructor with two parameters, invalidStudentId representing the invalid student ID and message representing the exception message getInvalidStudentId(): A method that returns the value of the invalidStudentId attribute setInvalidStudentId(String invalidStudentId): A method that sets the value of the invalidStudentId attribute

The InvalidStudentIdException class is designed to be thrown when an error related to an invalid student ID occurs By extending the Exception class, it can be handled by try-catch blocks or propagated up for higher- level handling in the program's control flow c InvalidNameException

The provided code defines a custom class named InvalidNameException that extends the Exception class in Java This class is created to represent a specific exception that occurs when an invalid name is encountered The InvalidNameException class has one private attribute: invalidName: A string that represents the invalid name

The InvalidNameException class provides the following methods: o InvalidNameException(): A default constructor without any parameters o InvalidNameException(String invalidName, String message): A constructor with two parameters, invalidName representing the invalid name and message representing the exception message o getInvalidName(): A method that returns the value of the invalidName attribute o setInvalidName(String invalidName): A method that sets the value of the invalidName attribute

The InvalidNameException class is designed to be thrown when an error related to an invalid name occurs By extending the Exception class, it can be handled by try-catch blocks or propagated up for higher-level handling in the program's control flow This allows developers to catch and handle specific instances where an invalid name is encountered, providing better error handling and feedback to users or other parts of the program d InvalidPhoneNumberException

The given code defines a custom class called InvalidPhoneNumberException that extends the Exception class in Java This class is created to represent a specific exception that occurs when an invalid phone number is encountered

The InvalidPhoneNumberException class has one private attribute: invalidPhoneNumber: A string that represents the invalid phone number

The InvalidPhoneNumberException class provides the following methods:

InvalidPhoneNumberException(): A default constructor without any parameters

InvalidPhoneNumberException(String invalidPhoneNumber, String message): A constructor with two parameters, invalidPhoneNumber representing the invalid phone number and message representing the exception message getInvalidPhoneNumber(): A method that returns the value of the invalidPhoneNumber attribute setInvalidPhoneNumber(String invalidPhoneNumber): A method that sets the value of the invalidPhoneNumber attribute

The InvalidPhoneNumberException class is designed to be thrown when an error related to an invalid phone number occurs By extending the Exception class, it can be handled by try-catch blocks or propagated up for higher-level handling in the program's control flow This allows developers to catch and handle specific instances where an invalid phone number is encountered, providing better error handling and feedback to users or other parts of the program e InvalidEmailException

The provided code defines a custom class called InvalidEmailException that extends the Exception class in Java This class is created to represent a specific exception that occurs when an invalid email address is encountered

The InvalidEmailException class has one private attribute: invalidEmail: A string that represents the invalid email address

The InvalidEmailException class provides the following methods: o InvalidEmailException(): A default constructor without any parameters o InvalidEmailException(String invalidEmail, String message): A constructor with two parameters, invalidEmail representing the invalid email address and message representing the exception message o getInvalidEmail(): A method that returns the value of the invalidEmail attribute o setInvalidEmail(String invalidEmail): A method that sets the value of the invalidEmail attribute

Important algorithms

In this program, I use the Linear Search algorithm to implement the search function

Linear search is a simple algorithm to search for a specific element in a list It works by checking each element in the list until the desired element is found or until all the elements in the list have been checked

The advantages of Linear search are: o It is very simple to write and easy to understand o Linear search is a straightforward algorithm to implement It involves iterating through each element in the list until the target element is found or the end of the list is reached o It can be used on any type of list or array, regardless of whether it is sorted or unsorted It does not require any specific ordering of the elements It can be easily adapted to handle various data structures, such as linked lists or associative arrays o Low memory requirement: Linear search does not require any additional data structures or memory overhead It only needs a small amount of memory to store the list itself o In the best-case scenario, where the target element is found at the beginning of the list, linear search has a time complexity of O(1), which means it can find the element quickly

➢ For my project, the data is not much, the data center is quite small, so I use this algorithm to conveniently and easily handle the function Here are some methods to apply linear search algorithm in my project:

The searchSubjectByName method, a linear search algorithm is applied to search for subjects by name in the subjects list Here is how the linear search algorithm is applied:

• First, an empty resultList resultList is initialized to store the found subjects

• Next, a regular expression (regex) is built to search for the subject name This regular expression is created by concatenating the string ".*" + key + ".*", where key is the search keyword This regular expression allows to search all subjects whose name contains the search keyword, regardless of the keyword's position in the subject name

• A Pattern object is then created from the constructed regular expression and the CASE_INSENSITIVE flag is set to enable case-insensitive searching

• Next, the for-each loop is used to iterate through each subject in the subjects list

• For each subject, a Matcher object is created by calling the pattern.matcher(subject.getName()) method on the pattern object and passing in the subject name This is used to match the subject name with a regular expression

• Next, the matcher.matches() method is called on the matcher object to check if the subject name matches the regular expression If it matches, i.e the subject name contains the search keyword, that subject is added to the resultList results list using the resultList.add(subject) method

• After traversing all the subjects in the subjects list, a resultList containing the subjects found is returned

In general, the linear search algorithm is applied using a regular expression to search for the subject name in the list and compare it with the search term Matched subjects are added to the result list and returned in the end

In the above code, a linear search algorithm is applied to find subjects by the number of lessons in the list of `subjects` Here is how the linear search algorithm is applied:

• An empty result list `resultList` is initialized to store the found courses

• Use the `for-each` loop to cycle through each subject in the `subjects` list

• For each subject, use the test condition to compare the number of lessons (`subject.getNumOfLesson()`) with the value from `fromVal` to `toVal`

• If the number of lessons for a subject is between `fromVal` and `toVal`, that subject is added to the `resultList` results list using the `resultList.add(subject)` method

• After going through all the subjects in the `subjects` list, the `resultList` results list containing the subjects that meet the number of lessons is returned

In general, a linear search algorithm is applied using a loop to cycle through each subject and check if the number of sessions for the subject is between `fromVal` and `toVal` Satisfied subjects are added to the result list and returned at the end

The remaining search functions are similar to the two search functions above, all applying linear search algorithm to search for elements according to the criteria of the application.

How to handle errors

In this section, I will discuss various situations that lead to the program's failure and provide solutions to address them Specifically, I will analyze the sequence of steps involved in processing and fix any problems related to validating the program's input fields and any incorrect processes

4.1 Error when user entered wrong input data

Figure 84: Validate process Sign Up account

In the above code I used try catch to catch error during account registration After the user has finished entering, the program will check whether the user input is correct or not, if it is correct, the registration will be successful, otherwise, it will throw an exception corresponding to the fields entered incorrectly and give valid example so the user can enter it properly In this registration, there will be 3 exceptions: Email is not fpt's mail, phone number is not enough 10 digits, and password is not valid So I caught the exception in the catch block by calling the corresponding exception methods in the InforFilterImp class to handle it

Figure 85: Input data of Student

In the above code, I used try catch to catch the error during adding a new student After the user has entered, the program will check if the user input is correct, if it is correct, the registration is successful, otherwise, it will throw an exception corresponding to the wrong input fields and give a valid example so that user input user can type it properly So I caught the exception in the catch block by calling the corresponding exception methods in the InforFilterImp class to handle it In addition, I also use an if-else statement to check if the student code already exists in the system, if it exists, it will show a message and ask the user to re-enter it, if not, then proceed add students to the system

Figure 86: Process write data to file

This is the process of writing data to the file I use try-catch to handle errors during file writing The program will run normally in the try block if there are no errors There are two possible errors:

• If a FileNotFoundException error occurs, which means the program cannot find the specified file, this block will be executed In this case, I simply printed the error message and the error stack to the screen using ex.printStackTrace() This helps me know exactly where the error happened and where it happened so I can fix it

• If any other IOException occurs, this block will be executed IOException is a generic exception class for errors related to reading or writing data I also use ex.printStackTrace() to print the error message and error stack to the screen

Figure 87: Process read data from file

Similar to the process of writing files, I also use try-catch block to process

• First, we read data from the file by creating a FileInputStream object with file as the file to read and an ObjectInputStream object with fis (the FileInputStream object) as the input parameter If an error occurs while opening the stream to read the file, it will throw a FileNotFoundException

• If a FileNotFoundException error occurs, it will be caught by the catch block (FileNotFoundException ex) below and I will print the error message and error stack for debugging The ex.printStackTrace() line of code prints the error message and the error stack on the screen

• If there is no FileNotFoundException, the program will continue to execute data = (List) ois.readObject(); to read data from the file If something goes wrong while reading the data, it could be an IOException or a

• If an IOException or ClassNotFoundException error occurs, it will be caught by the catch block (IOException | ClassNotFoundException ex) and we will print the error message and the error stack for debugging The ex.printStackTrace() line of code prints the error message and the error stack on the screen

• If no error occurs while reading the data, the data list data is assigned the value from ois.readObject()

• After the end of the try-catch block, the data list is returned to the method caller

The main purpose of printing error messages and error stacks is to help me troubleshoot and find out what went wrong while writing data to the file By displaying error information, I was able to pinpoint the exact location and cause of the error, then proceed to correct the error and ensure that the data was written and read to the file correctly

Figure 88: Process connect netbeans to xampp

In the above code, the error handling takes place in the `try-catch` block

• In the `try` block, I execute commands to establish a connection to the MySQL database I call DriverManager.getConnection to create a `Connection` object that represents the connection to the MySQL database If an error occurs during this process, it will throw a `SQLException` exception

• If `ClassNotFoundException` error occurs during JDBC driver class loading or `SQLException` error occurs during connection creation, the `catch` block will be executed

• In each `catch` block, I use `Logger.getLogger(DataControllerImp.class.getName()).log(Level.SEVERE, null, ex);` to log the error information This made it possible for me to troubleshoot and capture details of what went wrong

• Finally, if no error occurred during connection establishment, we return the created `Connection` object If there is an error, we return `null`

The error handling process in this code ensures that I can safely establish a connection to the MySQL database and handle errors that may occur in the process Logging error information helps me to capture detailed information about the error and understand the cause of the error to effectively repair and upgrade the source code.

Test

Test Junit

I use Junit to test the methods of two classes DataControllerImp and InforFilterImp a DataControllerImpTest

In this test class in the constructor, I declare the Subject, Student, Registering lists in the ArrayList object type I then add data to the lists using the add method

Figure 89: Contructor Class test DataControllerImpTest

To test the sort and search methods in this class I will call the search and sort methods respectively in the dataController class and pass the corresponding lists by name initialized in the constructors I use the assertEquals method to compare the expected result with the actual result

Page 113 of 159 Figure 90: Methods to test methods sort and search in DataControllerImp class

After running the test, I got 18 test cases by JUnit that were successful

Figure 91: Result test methods in class DataControllerImp by Junit b InforFilterImpTest

In this test class in constructor, I declare variable inforFilter of type InforFilterImp Then in the constructor I initialize the object of that variable again

Figure 92: Contructor Class test InforFilterImpTest

The methods to test data validate, I declare a valid string variable and a boolean isValid variable This isValid variable I will assign it with the value of the corresponding exception method when passing the valid variable I stop the Assert.asertTrue method to check if valid = isValid it will return true and vice versa

Figure 93: Methods to test validate data in InforFilterImp Class After running the test, I got 7 test cases by JUnit that were successful

Figure 94: Result test methods in class InforFilterImp by Junit

Test plan

Enter email: dlong@gmail.co m Enter phone:

Register fail, show message Email must have the extension

Enter email: dlong@fpt.edu. vn Enter phone:

Register fail, show message phone must have 10 numbers

Testing result

Enter email: dlong@fpt.edu. vn Enter phone:

Register fail, display message because password must have at least 8 characters including uppercase, lowercase letters, numbers and special characters

Enter email: dlong@fpt.edu. vn Enter phone:

Show message register successfully and added data to the database table

Add this account to database

5 Check if the register email already exists in the system

Enter email: dlong@fpt.edu. vn Enter phone:

Register failed, show message email was exist in the system

Enter email: dlongmt@gmail com

Login failed, show message email or password is wrong

Enter email: dlong@gmail.co m Enter password:

Add subject successfully, and show this subject in table

9 Check the subject that already exists in the system in the add process

Add fail and show messeage id was existed

Choose row to edit edit subject name SDLC to name:

Choose row to delete subject

Show a message whether you are sure you want to delete the course Click

Yes to delete the subject

12 Sort the list subject by name from a to z

Choose radio button in sort by name from a-z

Displays a list sorted alphabeticall y from a-z

13 Sort the list subject by name from z to a

Choose radio button in sort by name from z-a

Displays a list sorted alphabeticall y from z-a

14 Sort the list subject by number of lessons

Choose radio button in sort by number of lessons in ASC order

Display list by number of lessons in ASC order

15 Sort the list subject by number of lessons

Choose radio button in sort by number of lessons in DESC order

Display list by number of lessons in DESC order

16 Search subjects by approxim ate name

Choose radio button search subjects by approximate name then enter the character “a” and press the search button

17 Search subjects by number of lessons

Choose radio button search subjects by number of lessons then enter 80 to 90 and press the search button

Programmin g, Web design, SDLC, Database

Click the refresh button in the subject tab

All radio buttons are unchecked and the data is back to the original

09/08/2003 Email: hai@fpt.edu.vn Phone:

Add fail and show message full name cannot contain special characters and numbers

09.08.2003 Email: hai@fpt.edu.vn Phone:

Add fail and show message invalid because date of birth must be in dd/mm/yyyy format

09/08/2003 Email: hai@gmail.com Phone:

Add fail and show message invalid because email must end with

034203002414 Name: Nguyen Thu Hai1 Birth:

09.08.2003 Email: hai@fpt.edu.vn Phone:

Add fail and show message invalid because phone must have 10 numbers

09/08/2003 Email: hai@fpt.edu.vn Phone:

Add fail and show message invalid because student'id must start with 3 letters and end with

09/08/2003 Email: hai@fpt.edu.vn Phone:

Add fail and show message studentId already exists in the system

09/08/2003 Email: hai@fpt.edu.vn Phone:

Add successfully and show message

Select the row of student have id: gch210562 to edit then change the class name gch1106 to gch1107

Show the message whether you want to delete or not press yes to delete it from the table

28 Sort student by name from a-z

Click on the radio button sort student by name from a-z

Show list sorted by name a-z

29 Sort student by name from a-z

Click on the radio button sort student by name from z-a

Show list sorted by name z-a

Click on the radio button sort student by id

Show list sorted by name id in ASC order

31 Search student by approxim ate name

Click on the radio button search by approximate name and enter keyword: long

Student have name: Tran Duc Long

32 Search student by student’s id

Click on the radio button search by student’s id and enter keyword: gch210563

Click on the radio button search by major and choose technology

Enter studentId: gch210566 and click search student

Show message student not found

Enter studentId: gch210562 and click search student Enter subjectId:

Show message subject not found

Enter studentId: gch210562 and click search student Enter subjectId:

Show message The student has already registered for the subject

Enter studentId: gch210562 and click search student Enter subjectId:

Display the message whether you want to delete and click Ok to delete from the table

39 Sort register table by name

Select combobox Name ASC from a-z

Show the list of registered subjects sorting by name from a-z

40 Sort register table by name

Select combobox Name DESC from z-a

Show the list of registered subjects sorting by name from z- a

41 Sort register table by early-late register time

Select combobox early-late registration time

Show the list of registered subjects sorting by early-late registration time

42 Sort register table by late-early register time

Select combobox late - early registration time

Show the list of registered subjects sorting by late -early registration time

43 Find out what subjects students have register for by name click on radio button search by student name and enter keyword long showing 4 results, this student has registered 4 subjects

44 Find out how many student register for the subject from day to day click on radio button search by student name and enter keyword

Click on the create course button on the class division tab

Function Test case Pass Fail Note

The function to validate student by full name is under maintenance

Solution

Here I have changed a bit about the isNameValid method in the InforfilterImp Class I modified the regex variable "^([a-z]+)((\s{1}[a-z]+){1,})$";

Purpose of the above code I want the student name to have only letters from a to z and spaces are allowed in the name The first and last characters must be letters Full name must include at least 2 letters (letters) or more There is only one space between words

Figure 95: Edit code method isNameValid

From the above results, we can see that the repair process was successful The name has been edited by Validate at the Regex statement Middle reality with expected results.

Screenshots of running program

Sign up

When entering the application, the user must create an account to access the system

Login

Once you have an account, you can log in to the system

Tab subject

After logging into the system, the subject tab will appear first Here users can perform functions add subject, edit subject, delete subject In addition, users can sort the subject list by the corresponding criteria in the application or can search for subjects according to the corresponding criteria in this tab

Figure 99: Screenshot of subject tab

After the user clicks on the add Subject button, an Add a new Subject form will be displayed In this form there are 3 buttons, clear is to delete the entered data, cancel is to cancel more, add is to add data Note that users must enter full information to be able to add data

Figure 100: Screenshot of add subject

User can select a line then click on edit subject button Here an Edit subject form will appear, users can update the information they want Note the subject here ID cannot be edited

Figure 101: Screenshot of edit subject

Tab student

After the user clicks on the student tab Here users can view student information and perform the functions of adding student, editing student, deleting student In addition, users can sort the list of students by the corresponding criteria in the application or can search for subjects by the corresponding criteria in this tab

Figure 102: Screenshot of student tab

After the user clicks on Add students button, an Add a new Student form will be displayed In this form there are 3 buttons, clear is to delete the entered data, cancel is to cancel more, add is to add data Note that users must enter full information to be able to add data

Figure 103: Screenshot of add student

User can select a line then click on Edit students button Here an Update student form will appear, users can update the information they want Note the student here Identity card and StudentId cannot be edited

Figure 104: Screenshot of edit student

Tab register

After the user clicks on the Register tab Here users can view information about students who have registered for courses and perform the functions of adding registrations, deleting registrations In addition, the user can sort the list of students registered for the course by the corresponding criteria in the application or can search for them by the corresponding criteria in this tab.

Figure 105: Screenshot of Register tab

After entering the register tab the user can add a new register by clicking the Add register button Here an Add register form will appear so that users can help students register for the course Unlike the 2 forms, add student and subject first In this form, users only need to enter 2 lines, StudentId and SubjectId, then click on the corresponding search button, all student and subject information will appear if that id is in the system Then users just need to click on the register button and the registration will automatically be added without having to fill in the Register time box

Figure 106: Screenshot of add a new Register

Tab class division

The final function of the application is the Class Division Function After the user has the information of the registration table in the register tab, then the user can now click on the class division tab Here, the user clicks on the Create Course button and the entire course data will be displayed on the board Courses are graded in fourth Grade Subjects from grades A-Z Each course accommodates a maximum of 25 students

Figure 107: Screenshot of class division tab

Conclusion

In conclusion, this project has been a valuable learning experience for me To summarize the process, I began by clearly defining the project's objectives and then breaking down the requirements and goals into smaller, manageable tasks One of the significant objectives was creating the wireframe for the pages, which involved designing the functionality based on the requirements and goals In order to work with the Java programming language and the Java Swing platform, I needed to familiarize myself with NetBeans

Once I completed the coding steps, it was essential to thoroughly test the software for any errors I developed a test strategy and implemented scenarios to ensure an enhanced user experience Applying the Model-View-Controller (MVC) architecture to the program brought unexpected benefits The separation of code into three levels facilitated the organization and scalability of the web application logic It also allowed for quick identification of specific code segments and made it easier to add new features MVC was particularly useful during the initial planning phase, providing a framework for translating ideas into actual code Additionally, it helped reduce code duplication and ensured easier maintenance of the application

Finally, once all the preceding phases were successfully completed, the product launch phase began Users were able to test the app and provide feedback to aid in its further development

Powered by TCPDF (www.tcpdf.org)

Ngày đăng: 24/02/2024, 01:58

w