• Home
  • Blog
  • create a javafx or swing application for a bookstore that includes three total classes

create a javafx or swing application for a bookstore that includes three total classes

0 comments

For this project, you can choose to create a JavaFX or Swing application for a bookstore that includes three total classes:
Book class
This class will have the following instance data members:

ISBN
Title
Author Last Name
Price

Here is an example of typical values you might see for these data items:

ISBN
Title
Author Last Name
Prices

979-0-470-50225-9
Intro to Java Programming
James
50.54

0133761312
Advanced Java
Murach
149.99

978-1890774783
Java Servlets and JSP
Downey
44.43

There should be an accessor and a mutator method for each data member.
The mutator methods must throw the following custom exceptions when applicable. You will need to create these as custom exceptions that extend Exception.

OutOfRangeException when the ISBN is smaller than 10 digits or larger than 13 digits.
InvalidISBN13Exception when the first 3 digits of a 13 digit ISBN are invalid (must be either 978 or 979).

Bookstore class
This class will have an ArrayList as a private data member that holds Book objects. Create an AddBook method for this class that accepts a Book object as a parameter and adds it to the private ArrayList.
Foothill Class
This class will make a user interface for this application using JavaFX or Swing (your choice). You will need input boxes, a SAVE button and a click event for the button. When the user clicks on the SAVE button, you will need to perform the tasks listed below. These tasks can be performed in the method that handles the click event, or you can put it in a separate method and call that method when the event is triggered:

Create an object of the Book class
Call the Book class mutators and pass the data from the inputboxes. This should set the Book class private data to the values passed as arguments to the mutator method.
Handle any exceptions that are thrown explicitly by the methods that are called. Also, handle any NumberFormatExceptions that may be thrown when working with form data. Handle all exceptions by notifying the user in a label on the user interface if corrections are needed.
Create an object of the Bookstore class.
Call the Bookstore class’ addBook method and pass the Book object. This method should add the book object to the ArrayList and return true if it is successfully added.
If the book is successfully added, display a message in a label on the user interface indicating that the book was saved.

Feel free to add whatever you need for testing purposes.

Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post create a javafx or swing application for a bookstore that includes three total classes appeared first on Essay Writers.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}