Highlights
The purpose of this lab is to practice building a desktop GUI based program in Java. You should be able to use all the logical classes from your assignment II without any changes. You even can start from assignment I sample solution. The only class that you need to change is your text based UI which should be changed to Swing based GUI (several JFrames). You may use Swing Toolbox. This will be the first iteration of GUI design for your Assignment III
A jar file (java executable program) is provided with this lab which is the demo of the application you need to implement.Run the demo to see exactly what you need to do. Also watch lab 7 tutorial (located in “Recorded Lectures” folder as well as lab 7 folder) to understand all the elements of the demo. Also study the BankUI lecture code to understand how to do this lab. In this lab we only consider User Login. Admin login will be done in your assignment III.
The program starts with a login page. You can log in with “john123” and “password1”. You can click on the “list of users” menu to see a list of all the users and passwords. The menu also has options to save mobileCompany and load it from file. A sample database binary file is provided with the program. Test code includes several users but you can add more plans or change the user information and save it.
Note: Login JFrame has a field MobileCompany mobileCompany and this is the relation between your UI and the Logic/Domain of your software.
After successful login the UserUI form will be displayed with several tabs. Note that UserUI JFrame has several fields that will be send to its constructer from Login form:
ArrayList<String> cities; //a list of distinct user cities that is generated from a corresponding method populateDistinctCities() inside mobileCompany.
User user; // the user that has been validated in the login process and sent to UserUI Login login; // a pointer to the login form to be able to return after logout.
Work with each tab left to right and implement it in your code:
1) Edit Personal Data: To edit the current user information. See that a list of distinct city names in the company is populated in the comboBox. You can add a new city by ticking the checkbox and type the new city name. The new city will be added to the comboBox as well. Wrong data type (e.g., string instead of integer for street number) will throw an exception that is caught in a catch block which displays a Message Box.
2) Add Plans: To add a plan to the user. See that how choosing the proper radio button will change the text fields. Any errors result in a Message Box. The plan will be created and sent to user.addPlan() method.
3) Find a Plan: To search for a plan and display it in a text area. If ID is not found a proper message will be displayed in the text area. Note that the plans are appended to the Text Area.
4) Plans Information: To display all the user plans in a Table. See that how different plan types include NA (Not Available) fields (e.g., Personal Plan has NA for ABN and Number of Employees). There are buttons to Delete and Update the selected plan in the table (when you click and select it the whole row will be highlighted). Right click on the selected row and you will see a popup menu will be appeared which can be used to do the same tasks. Try to also implement the popup menu as well.
Clicking on update button will open a new JFrame (UpdateUI) . This will be explained later.
5) Filter Plan: To display all the plans. Typing in the Mobile Model text field will filter the list of plans based on mobile model automatically (by calling MobilePlan.filterByMobileModel()). In addition you can type a date as YYYY/MM/DD in the Expiry Date field and click on “Filter by Date” to filter the list based on the date in addition to mobile model. If fields are empty, no filtering based on either model or date will be done.
In addition, there is a checkbox “Sort by Username” which can be used to show the list of plans based on original order or sort them by username ( using Comparable and Collections.sort() or sortPlans() method inside the user). The algorithm to do this is as below:
Anytime the panel is loaded or user types a character in the mobile model textfield or clicks on the filter by date, or ticks or unticks the checkbox to sort by username (Note: these are all events) do this:
- Create an ArrayList<MobilePlan> plans as a shallow copy of all user plans.
- if modelText is not empty then plans=MobilePlan.filterByMobileModel(plans, model).
- if expiryDateText is no empty split it by “/” and create a MyDate object and then call the filterByExpiryDate the same as other one to filter the list again.
- if the sort CheckBox is selected then sort the plans by using plans=Collections.sort(plans)
- fill the table by iterating over plans ArrayList.
The UpdateForm has these fields:
MobilePlan plan;// the plan to be populated and updated
UserUI userUI;// a pointer to the userUI to be able to return to it and also update the tables
When user clicks on update button in plans information Tab (or using the update option from the popup menu) the UpdateUI form will be displayed. The plan details will be populated in the form. User can change whatever and click on update to update the record. Note that how the plan type is detected ( by using instanceof). However the type as well as ID is read-only and cannot be changed.
Note that clicking on logout menu in the UserUI will redirect the program to login form again. User can choose the save menu to save all the changes in the file.
This DPIT121 - IT Assignment has been solved by our IT experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.