Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Final Project

Description

In this project we will improve our personal lending library tool by (1) adding the ability to delete items from the library, (2) creating a graphical user interface that shows the contents of the library and allows the user to add, delete, check out, or check in an item, (3) using a file to store the library contents so that they persist between program executions, and (4) removing the 100 item size restriction.

Sample Run

The video final.swf on the course website shows a sample run of this program.

Suggestions
You have the freedom to design your program however you want, provided that it meets the requirements and follows good design principles. However, if you would like some ideas of where to start, they are provided in this section.

- Modify the Library class to use an ArrayList rather than an array (to eliminate the size limit)

- Rewrite all of the methods in the Library class that display error messages to throw exceptions

- Add the following methods to the Library class:

- public void delete(String title) - Removes the item with this title from the library (the ArrayList of MediaItems)

- public void save() - Writes all of the items out to the data file library.txt. For each MediaItem, write its title, format, whether or not it is on loan (true/false), who it is loaned to (or null, if not on loan), and the date is was loaned (or null, if not on loan). Write out some weird symbol in between each of these things - be sure to pick something that is not likely to appear in a title or someone's name.

- public void open() - Reads in the data from library.txt, recreates the MediaItems, and puts them into the ArrayList. When you read in each line, you will need to tokenize it based on whatever symbol you picked. Then create a new MediaItem object and set the fields appropriately.

- Create a JavaFX LibraryGUI class

- This class should have a Library object as one of its fields. In the LibraryGUI constructor you will need to call the library constructor method to initialize this field and then call its open() method to read in the items from the data file.

- Use a javafx.scene.control ListView class to display the contents of the library (see Chapter 16 of Liang, pp. 647-651, as well as http://www.javafxcookbook.com/home).

The code below shows how to use the ListView control to display list of items (http://www.javafxcookbook.com/home). The control takes a data model (a sequence of items) as its data source. The code below shows how it is used:

ListView { width:w-200 height:h-50
effect:DropShadow{offsetY:3 offsetX:3} items: for (i in [1..50]) "Cloud {%5s i}"
}

The snippet above would produce the ListView shown in the following figure:

161_Figure.jpg

- Provide buttons for adding, deleting, checking in, and checking out items

- Attach action listeners to the buttons that use dialog boxes to get any required information from the user and then call the appropriate method in the library. If the user currently has an item selected in the list, assume this is the item they want to check in/check out/delete.
Hints
When the user has an item in the list selected and they choose to check in, check out, or delete that item, you will need to get the item's title in order to pass it to the appropriate library method. To do this, you can use the following code:
Object selected = list.getSelectedValue(); // gets the selected item String s = selected.toString(); // converts that to a String
String title = s.substring(0, s.lastIndexOf("(")); // extracts the title String title = title.trim(); // removes any trailing whitespace
You will need to call the Library class's save method when the user closes the application.
Rubric (Each item is worth four points, for a total of 52)
- The contents of the library persist across program executions

- The program allows the user to delete items

- The library is not limited to a set number of items

- The entire program is handled through a graphical interface (e.g. the console is no longer used at all)

- The GUI allows the user to see the contents of the library and add, delete, check in, and check out items

- The GUI indicates which items are on loan

- The user can choose which item to check in, check out, or delete by selecting it in the list rather than typing in the title

- The contents of the list are kept in sync with the contents of the library

- If an exception occurs, the program displays an appropriate error dialog box to the user

- If the user tries to do something nonsensical, such as checking in an item that is not checked out, they are notified with an error dialog

- The program compiles

- The program follows good coding conventions and design guidelines

- The program runs

Attachment:- TranTuanpPersonalLendingLibrary.zip

Java, Programming

  • Category:- Java
  • Reference No.:- M92394571
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As