Department of Computer Science: Assignment 3
Department of Computer Science: Assignment 3
UW
Assigned Date: 10-12–19
ASSIGNMENT 3
You need to create a GUI for a Salon Service. We will only consider the ordinary customers for now.
You will be provided with the Customer class that you will use at the back-end of this GUI.
Note: It is not mandatory to follow the given layout. You can come up with even better GUI. Keep
in mind additional marks will be given for a good looking GUI.
When you enter correct username and password and click login.
o The current frame becomes invisible
o An instance of MainFrame becomes visible
When you enter incorrect username or password and click login.
o Displays message incorrect username and password
Hint: Create a different class BillPanel and CustomerPanel for your ease. Both class extends
JPanel.
You will need to dynamically add and remove panel from the final panel p1.
try{
p1.remove(bp);}
catch(Exception e2){
}
cp=new CustomerPanel();
p1.add(cp, BorderLayout.CENTER);
validate();
}
o The application should get current date automatically and display it as label.
o If you click Create button, a Customer class object should be initialized, with the data
present in the JComponents.
Customer class object requires; customer name and Visit class object.
Obtain name from JTextField.
A Visit class object requires; current date, service charges and product charges.
Get currentDate from System. Get service charges from JTextField. Get product
charges from text of currently selected JRadioButton.
Note: Adding pictures with RadioButton is compulsory, it carries marks
If you click generateBill button
o The panel in center of MainFrame changes to a different Panel.
Hint: Create a different class BillPanel and CustomerPanel for your ease. Both class extends
JPanel. You will need to dynamically add and remove panel from the final panel p1.
try{
p1.remove(cp);}
catch(Exception e2){
}
bp=new BillPanel();
p1.add(bp, BorderLayout.CENTER);
validate();
}
o Call the printBill() function over the Customer class object and get the bill in String form.
Display it using any JComponent.
If Customer has not been created display, “No Customer Found” on any
JComponent.
If you click logout button
o Make the MainFrame invisible
o Make the StartFrame visible