













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
just passed this just passed this just passed this just passed this just passed this
Typology: Assignments
1 / 21
This page cannot be seen from the preview
Don't miss anything!














Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Đinh Xuân Trường Student ID GCH Class GCH0908 Assessor name Đinh Đức Mạnh Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Trường Grading grid Grade (0-10)
Grade: Assessor Signature: Date: IV Signature:
I. Introduction In this assignment, I have to develop an application to solve a small business problem. The problem requires a graphical user interface with features that required reading/writing data from text files, working with a collection of data. The application must handle errors so that it will not crash on the end-user side. The application also needs to be fully tested before the production phase. So, I made an application enough response named "Manage Employee", and I will describe clearly in my report. II. Requirement In Assignment, the requirement is about to develop an application to solve a small business problem. In the problem, it includes requires a graphical user interface with features that required reading / writing data from text file, working with a collection of data and can handle errors.
After read and understand the requirement, I created an application that have enough to solve specific problem about “Manage Employee”. The Manage Employee application will describe clearly in my report. III. UI Design UI Design Manage Employee IV. Implementation
1. Apache NetBeans IDE
Package and import libraries Libraries are using here:
The program has 5 features: Read file, Write File, Delete, Edit, Search. Program structure
3. Explain classes A class is used in object-oriented programming to describe one or more objects. In my program, class called Employee with 6 properties string: Id, Name, Address, Gender, Position, Salary.
Program structure
There is the way add feature works: +) Declare var id, name, address, gender, salary to storage string that manager input by getText(). +) Use ‘if else’ statement to check. In this case, this statement is using for if the text field is empty, a notification will show up with “Missing information of employee” Notification of missing information +)Using comboPosition.getSelectedItem() to get the item from Position, it has 5 (Employee, Trainee, Expert, Manager, Director). After this, pressed it to string and storge in var positon declared, var employee also store information after insert. Position +) After insert completed, the table will clear by setText(“”) and display information inputted by display(employee). A notification will show up with “Add employee completed”. Inputted information completed +) When insert informations completed, to write file, import libraries filechooser.FileNameExtensionFilter and JFileChooser to work.
Edit feature code +) If manager did not insert a data of information in table, so, use if else statement, if size of class employess is under 0, the notification will show with “No data in the table”. If manager did not choose a row, the notification will show with “Please choose a row”. +) When manager click on the row want to edit. Declare employee is var format, that mean after chose from class employee, it will storage in employee. txtId, txtName, txtAddress, txtGender, txtSalary will display in text field each information by getId, getName, getAddress, getGender, getSalary. Position also display by comboPosition.setSelectedIndex(i). +) Add button is set text to Update button to save changed and ActionState. Edit will take the mission.
Delete feature code +) If manager did not insert a data of information in table, so, use if else statement, if size of class employee is under 0, the notification will show with “No data in the table”. If manager did not choose a row, the notification will show with “No row is selected”. Declare chose to save the Row want to delete. +) When selected, a notification will show with “Do you want to delete this employee?”, two options Yes or No will display in new box by ‘YES_OPTION’. If NO, this row will still in table. If YES, this row will be delete. It delete from class Employee and table. fireTableDataChanged is for notifies all listeners that all cell values in the table's rows may have changed. Completed delete, a notification will display with ”Delete employee complete”.
Example in my program: Example In case, when manager using application, after click on read file, output code showed an Error. This happen when coding errors made by the programmer, errors due to wrong input, or other unforeseeable things. To handle this problem but still made program work smoothly, I added ‘try - catch’ statement.
Example ( 2 ) When I run application, it is still work after I handle error with “try - catch” statement.
Add feature Edit feature changed from Nguyễn Văn A to Nguyễn Văn G
Delete feature Read file feature Search feature