GithubHelp home page GithubHelp logo

mfkimbell / bookstore-manager Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 21 KB

This project's goal was to create an interface that a bookstore manager could use to keep track of the inventory of his bookstore, all of his customers, and which customers were renting which books.

Java 100.00%

bookstore-manager's Introduction

bookstore-manager

This project's goal was to create an interface that a bookstore manager could use to keep track of the inventory of his bookstore, all of his customers, and which customers were renting which books.

Tools Used:

  • Java Swing for tabbed panels, buttons, Jlabels, Jscrollpane, and Jtables

Additionally, it needed to be able to add both new books and new customers to the library. All of the data was read from and saved to a txt file that served as the database.

When the application is first opened, the GUI defaults to this screen: Screen Shot 2022-11-19 at 12 17 32 PM

The data for the bookstore is automatically uploaded from a txt file with the format "Books:\n", (book data), "RentedBooks\n", (rented book data), "Customers\n", (customer data)

Screen Shot 2022-11-19 at 12 19 06 PM

The books are stored in a "Book" object and the customers are store in a "Customer" object that stores the necessary data.

Clicking the "Display Customer" button displays a list of all customers in the bookstore and their stored data. If there were more customers than could fit, a JscrollPane would allow you to scroll to view more data.

Screen Shot 2022-11-19 at 12 21 29 PM

Clicking "Add Customer" prompts the user to enter all of the required information for a customer, apart from what they've rented, which will default to "No Books Rented"

Screen Shot 2022-11-19 at 12 23 35 PM

Hitting "Display Customer" again, we see that the new customer has been added. Additionally, it also has been added to the database.

Screen Shot 2022-11-19 at 12 25 05 PM

Screen Shot 2022-11-19 at 12 26 53 PM

If the user hits "Search" with no input, the customer table will not dislpay any data. If the user enters either the first, or last name, all customers with matching data in one of those fields will be displayed. Here is what happens when I type "Long", a name of one of the customers.

Screen Shot 2022-11-19 at 12 29 00 PM

If the user clicks on the "Books" tab, they will be directed to a panel with a similar setup to customer. Clicking "Display Books" will display all books in the same manner as customers.

Screen Shot 2022-11-19 at 12 29 28 PM

The search bar works in the exact same manner as the customer tab except it searches by book title. Here is the result for searching for "Green Book".

Screen Shot 2022-11-19 at 12 54 33 PM

If the user clicks "Rent Book", it will prompt the user asking for "first name of customer", "last name of customer", and then "book title". As seen here.

Screen Shot 2022-11-19 at 12 32 54 PM

If the copies was already at 0, the user would recieve a popup that read "No copies available for rent". If the customer entered a book not in the library's database, the user would recieve a popup that said "This book is not in the library". If the user typed the name of a non-existent customer, the user would receive a popup that read "Customer does not exist". After clicking "Display Books" again, you can see that the "copies" of the book has been decreased by 1 as seen below. All changes are also saved in the database.

Screen Shot 2022-11-19 at 12 34 09 PM

If the user clicks "Add Book", the user is prompted for all the information of the new book.

Screen Shot 2022-11-19 at 12 38 27 PM

After the user clicks "Display Books" again, the new book has been added to the table.

Screen Shot 2022-11-19 at 12 40 16 PM

Finally, on the "Rented Books" tab, the user can search a customer by last name and see all the books they have rented, along with the author of those books. After creating the new user "Brock Hampton" and adding "Purple Book", I also added "Red Book" and "Blue Book" to their rentals. After searching Hampton and hitting "search", the following results are displayed.

Screen Shot 2022-11-19 at 12 44 16 PM

If Hampton had not rented any books, it would have defaulted to and displayed "No Books Rented" where the title of the books are currently. Additionally, all changes in the GUI are reflected and saved in the database.

bookstore-manager's People

Contributors

mfkimbell avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.