Develop a Java GUI application using Swing components

Assignment Help JAVA Programming
Reference no: EM132293905

GUI and Inheritance

Objectives

• Gain an understanding of Object-Oriented Programming (OOP) concepts in Java such as Inheritance, Aggregation and/or Polymorphism.
• Obtain practical skills in Graphical User Interface (GUI) programming by implementing an event-driven application using Java Swing library components.
• Develop and test stand-alone Java applications.

Background

Friendly Student Accommodation (FSA) is a real estate agent that rents individual rooms and whole properties to students. They manage various types of rental properties, ranging from wooden houses to apartment units in city skyrises. You have been hired by FSA to develop a Java GUI application to help manage their business.

This proposed software will allow FSA staff to enter the details of newly acquired rental properties into the application. FSA staff will be able to manage these rental properties, such as changing their rental prices, the inclusions that come with these rental properties, and so on. The application will also create periodic backups of the properties stored within.

There are two categories of rentals that FSA manages.

1. Room Rental
a. These are rooms inside whole properties that are rented to individual students.
b. For example, a house has 5 rooms within and they can be rented to 5 different students separately.
2. Whole Rental
a. These are rental properties that are rented as a whole to a student.

Develop a Java GUI application using Swing components to implement the application.

You are allowed to work on this assignment by yourself or in pairs.

Requirements
The functional requirement for the proposed application are:

Phase 1 (Assignment 1)
1. Enter 1 rental property into the application
2. Edit and update the details of this rental property
3. Display a list of previously entered rental properties in the system (should only display the 1 entered earlier)
4. Exit the software safely

Phase 2 (Assignment 2)
1. Enter the more than 1 rental property into the application
2. Retrieve the details of rental properties previously entered
3. Edit and update the details of rental properties previously entered
4. Deleting rental properties from the application
5. Display a list of available rental properties in the system
6. Output the list of available rental properties into a file
7. Exit the software safely

Assignment 1 Tasks

For Assignment 1, you only need to enter 1 rental property into the application.

1. Designing your classes

Each rental property entered has to be either Individual rooms or Whole properties. More categories might be introduced in future but that is outside the scope of this project.

The attributes required for the 2 rental property types are shown in the table below.

Room Rental

Whole Rental

Rental ID

Rental ID

Address

Address

Weekly price

Weekly price

Furnished

Furnished

Description

Description

Couples allowed

Number of rooms

Attached bathroom

Number of bathrooms

 

Garage space

 

Pets allowed

When developing Java classes for these 2, consider how the common attributes above might affect your design using Inheritance and/or Polymorphism.

HINT: An abstract super class Rental is needed to bring these 2 together.

The table below provides information about the attributes needed in your rental properties.

Attribute

Data type & Comment

Rental ID

Auto-generated

Room: R followed by 4 digits. Eg R1254 Whole: W followed by 4 digits. Eg. W0001

Address

Text

Weekly price

Currency

Furnished

True/False

Description

Text

Couples allowed

True/False

Attached bathroom

True/False

Number of rooms

Whole number

Number of bathrooms

Whole number

Garage space

True/False

Pets allowed

True/False

2. Designing your GUI

You are to design your own GUIs but please take note of the following:

- When designing and developing your GUI, keep in mind how a user might enter the details for rental properties.

- There is a list of functions needed for this application. i.e. entering details, editing details, displaying list of properties, etc.
With this in mind, consider designing a "default" landing screen that has options (buttons/menu items/tabs) for the user to bring up the other screens developed for the various functions of your application.

- How can the user select which rental property type to enter?
o Allow the user to select which of the 2 types of rental property they want to enter and bring up the relevant input screen (different input screens)
o OR Allow the user to select which of the 2 types of rental property they want to enter and enable/disable the respective input fields on the input screen (single input screen)
o OR Create your own design. Check with your local tutor whether your design is acceptable or not.

- Editing the details of the previously entered rental property
o There are many ways to implement this.
o You can reuse the original input screen add an [Update] button. To update, you populate the fields from the data in your object. When the [Update] button is clicked, your application can overwrite all the old values with the new.
o OR You can use a totally new and separate input screen for editing.
o OR Create your own design. Check with your local tutor whether your design is acceptable or not.
o Do not forget to re-validate inputs when updating.

- When displaying the list of previously entered rental properties, you need to display for each property:
o Rental ID
o Rental type (Room or Whole)
o Address
o Weekly price
o Furnished
o Description
o Couples allowed (when relevant)
o Attached bathroom (when relevant)
o Number of rooms (when relevant)
o Number of bathrooms (when relevant)
o Garage space (when relevant)
o Pets allowed (when relevant)

- JFrames should be used and can be designed graphically (drag and drop using NetBeans) or manually using Textpad or similar.
Bonus marks will be given if your GUI was built manually using Layout Managers, since more effort and learning is involved.

3. Implementation requirements

- You must create an object(s) (based on your design in "Designing your classes") to store the details of your rental property. Simply saving the entered values into variables in your application will not give you any marks.

- Polymorphism in your code
o Assignment 1
› You must use a variable of the Rental class to reference the object that will store the details of the rental property.
› The object created will be dependent on the type of rental property selected. i.e. if the user selected "Room Rental", then a RoomRental object should be created instead of a WholeRental object.
› You will also use this reference variable when updating and displaying the rental property.
o Assignment 2
› You will need to use a Dynamic Data Structure (ArrayList or LinkedList) of Rental objects to store all the rental properties.

- After successfully entering the details of a rental property, the GUI should be reset and ready for another entry.

- The following must be disabled until after at least 1 rental property has been entered. You can either disable the section completely or display an error message to the user.
o Function to edit the previously entered rental properties
o Function to display the list of previously entered rental properties

- When exiting the application, a dialog must appear to confirm whether the user really wants to exit.

- Your code must be commented sufficiently.
Areas to note are:
o Comment headers at the top of each class that includes the name of the class, the purpose of the class, student name, student id
o All methods should have a method headers that describe what the method is trying to do
o Instance variables: what they are to be used for
o Decision structures: what will happen for each decision path
o Loop structure:
› what happens during each iteration of the loop
› when will the loop end
o Other code sections that need additional explanation should include comments as well.

- Variable/method names should be meaningful. Camel notation should be used as well.

- Constants should be used when appropriate. i.e. literal Strings or numbers

- Currency must be stored as a double and must always be displayed to 2 decimal places.

4. Validation requirements

- Input values have to be of the correct data types. Some of these can already be validated automatically depending on the type of GUI component you chose in your GUI design.

- Rental ID - Must start with "R" or "W" and followed by 4 numbers.

- All values must be entered/selected before a new rental property can be saved into your application. Error messages should be shown if something is missing.

- All values must be validated again when editing and updating existing rental properties.

5. Assignment Report

You will need to write a report that includes the following:

- Cover page that shows the unit code and name, assignment number, your name and student ID number

- "Screen Shots" section
o Includes screen shots of your running application.

o All relevant screens, error messages, and dialogs should be included.

o Each screenshot should have a description (caption) of the respective screenshot written below.

- "Reflection" section
o In this section, you need to write about the following (paragraphs or in a list)

o What difficulties did you encounter while working on this assignment?
Eg. Learning how to use NetBeans, not enough time, etc

o If you were able to complete all the required tasks
› What do you think contributed to your success?
› Is there anything you can do better in future?

o If you were not able to complete all the required tasks
› Which sections were you not able to complete?
› What reasons do you think prevented you from completing them?
› How can you avoid these in reasons in future?

- "Task Breakdown" section (only needed if assignment was done in a pair)
o Use a table or a list to show how you distributed the work among yourselves

Reference no: EM132293905

Questions Cloud

In what order will the cylinders be serviced : a) In what order will the cylinders be serviced under the following scheduling policies?
Define analysis of a stress prevention and management : Students will complete a literature review and analysis of a stress prevention and management topic from the list below. Guided Imagery, Meditation.
Consider who influences the customer decision making : When pharmaceutical companies market to customers they must take the time to consider who influences the customer’s decision making.
Please discuss any algorithm related to cryptography : Please discuss any algorithm related to cryptography (encryption and/or decryption) with an example
Develop a Java GUI application using Swing components : COIT11134 - Object Oriented Programming - CQUniversity - GUI and Inheritance - Develop a Java GUI application using Swing components to implement application
Evaluate the training outcomes and support training transfer : Explain the benefits of the training (Customer service training) by discussing how you would evaluate the training outcomes, support training transfer,
Single-cycle datapath : a. How long will one loop iteration take in a single-cycle datapath? b. How long will one loop iteration take in a multi-cycle datapath?
Evaluate the value of the pop press article : Discuss the article in light of your research on your particular population of interest. You need to evaluate the value of the pop press article in light.
How might cultural expectations for physical activity : How might cultural expectations for physical activity in boys and girls relate to athletic participation and performance?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a login and accounts page

For this assignment, you will build upon your prior assignment 2. Using the style and pages of your assignment 2, you need to create a login and accounts page.

  Write a program that simulates a simple calculator

Write a program that simulates a simple calculator. It reads two integers and a character. If the character is a +, the sum is printed; if it is a -, the difference is printed; if it is a *, the product is printed; if it is a /, the quotient is pr..

  Write a program that extends the bankaccount class

To verify the banks total, read the file and write a program using a CarLoan class that extends the BankAccount class (found on page 671 - 672 in the textbook).

  Java program to compute invoice for client

You need a java program to compute the invoice for client and then print out invoice to the screen. The consulting rate is $200 per hour.

  Expressions in the matlab command window

These problems all involve typing expressions in the MATLAB command window. To complete this homework assignment, turn in a text (or Word, or PDF) file containing the expression that you type to respond to each problem.

  Write a program counter.java that is a thread

Write a program Counter.java that is a Thread that counts up to a limit with random pauses in between each count.

  Identify all of the lines of code within the program

Identify all of the lines of code within the program that are associated with obtaining user input. This can be done by either copying the lines into your answers or highlighting the lines within the code.

  Develop a class named kitchentimer

You will develop a class named "KitchenTimer". This is the first class you will be developing from scratch. The class will have two fields, one to track the minutes remaining and another to track the seconds remaining.

  Give java code for performing add and remove methods

Give Java code for performing add(e) and remove(i) methods for game entries, stored in an array a except now don't maintain the game entries in order.

  Managing error handling and files

review the concept of Files from your text book. Double-Click on the IDE (Eclipse or Java Beans) on your desktop as directed by your Instructor

  Implement the program using for-loop

Implement the program using for-loop - Complete the method, which compares two parameters and returns

  Mean and standard deviation write a program that reads a

mean and standard deviation. write a program that reads a set of floating-point data values from the input. when the

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd