Question

GUI programming

Please use netBeans 389F4EA3-425C-41D6-92F8-F073D685EF4E.jpeg


Exercise 4:

A librarian needs to keep track of the books he has in his Library.

1. Create a class Book that has the following attributes: ISBN, Title, Author, Subject, and Price. Choose an

appropriate type for each attribute.

2. Add a static member BookCount to the class Book and initialize it to zero.

3. Add a default constructor for the class Book. Increment the BookCount static member variable and an initialization constructor for the class Book. Increment the BookCount in all constructors.

4. Add the setters and getters to the class Book and a toString() to the class Book.

5. Create the following GUI to manipulate the class Book:

1. Read the available books from the input file with its name specified by the user. (Hint: Read a whole line using Scanner nextLine() method then split it on colons using String split() method).

2. When you read one book information, create a Book object, and use its toString() method to add it to the Text area (Hint: use the append() method of the text area).

3. Add new books using the “Add Book” button. Collect information from the text fields, then create a Book object, and use its toString() method to add it to the text Area. (Hint: use the append() method of the text area).

4. Display the BookCount attribute as the current number of books. Use Book.getBookCount() to retrieve the current number of books.

5. Save the new book list to an output file with its name specified by the user

6. Implement the Clear button to clear all text fields.

7. Make sure to handle the exceptions if any might occur. File Not Found Exception, Number Format Exception,

and all other exceptions.

8. Change the fields colors and status message based on the actions.

 


0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
GUI programming
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • GUI programming

    Exercise 1: Create a simple Graphical User Interface (GUI): Create new JFrameForm and use the Palette to drag and drop the Swing Containers and Controllers like the figure shown. Your Form should accept a file name in its text field. When the user presses OK Button, the content of the String array appear in the Text area below. Handle all Exceptions (File Not Found Exception)

  • Please use python Programming Language: Select one of the following topics: Band Character Account Create a...

    Please use python Programming Language: Select one of the following topics: Band Character Account Create a class based on your chosen topic. Make sure to include at least four attributes of varying types, a constructor, getters/setters for each attribute w/input validation, a toString, a static attribute, and a static method. Then, create a function (outside of your class) that connects to a text file which should contain the attributes of several objects. Read the data from the file, use the...

  • Java: student directory GUI You need to implement three classes: Person Student StudentDirectory StudentMain Start by...

    Java: student directory GUI You need to implement three classes: Person Student StudentDirectory StudentMain Start by implementing Person and Student classes. Once you are sure you can serialize and deserialize and ArrayList of Students to and from a file, move on to building the GUI application. Person: The Person class should implement serializable interface. It contains the following: Person's first name (String) Person's last name (String) Person's id number Person's date of birth (Date) public String toString(): This method method...

  • answer in c# console application. File l/O Create a Person class (firstName, lastName, phoneNumber, gender (Use...

    answer in c# console application. File l/O Create a Person class (firstName, lastName, phoneNumber, gender (Use radioButtons for gender in the GUI) ) Create a List<Person> Create a GUI that will collect the Person information from the user and have 3 buttons: Add, Display, Read. Add button Add the just created person to List<Person>, and append to a text file Display button > print out all persons currently in the List<Person> in a label in a visually attractive way Read...

  • Please try to write the code with Project 1,2 and 3 in mind. And use java language, thank you very much. Create an Edit Menu in your GUI Add a second menu to the GUI called Edit which will have one me...

    Please try to write the code with Project 1,2 and 3 in mind. And use java language, thank you very much. Create an Edit Menu in your GUI Add a second menu to the GUI called Edit which will have one menu item called Search. Clicking on search should prompt the user using a JOptionPane input dialog to enter a car make. The GUI should then display only cars of that make. You will need to write a second menu...

  • GUI programming

    Exercise 2:Add a list of numbers in the text area, then calculate their Maximum, Minimum and Average. Use the following GUI to build your application. Handel all exceptions.Exercise 3:Complete the program below in order to make run properly by competing validName methods and add try- catch block in the main method

  • Java language (a) Create a class HexEditor with a constructor which creates a 5x10 text area...

    Java language (a) Create a class HexEditor with a constructor which creates a 5x10 text area in a Frame. Also add a pull-down menu with a menu item "Load". Copy the class as the answer to this part. (b) Create another class TestHexEditor with a main() method which creates an object anEditor of the class HexEditor and displays the frame in part (a) using setVisible(true). Copy the class as the answer to this part. (c) Make changes to the class...

  • C# programming 50 pts Question 2:2 1- Create the base class Book that has the following instance variables, constructor, and methods title (String) isbn (String) authors (String) publisher (Strin...

    C# programming 50 pts Question 2:2 1- Create the base class Book that has the following instance variables, constructor, and methods title (String) isbn (String) authors (String) publisher (String) edition ( int) published year (int) Constructor that takes all of the above variables as input parameters. set/get methods ToString method// that return sting representation of Book object. 2-Create the sub class New_Book that is derived from the base class Book and has the following instance variables, constructor, and methods: title...

  • Please help with a source code for C++ and also need screenshot of output: Step 1:...

    Please help with a source code for C++ and also need screenshot of output: Step 1: Create a Glasses class using a separate header file and implementation file. Add the following attributes. Color (string data type) Prescription (float data type) Create a default constructor that sets default attributes. Color should be set to unknown because it is not given. Prescription should be set to 0.0 because it is not given. Create a parameterized constructor that sets the attributes to the...

  • Create a File menu in your GUI. Add a file menu to your clockGUI with options...

    Create a File menu in your GUI. Add a file menu to your clockGUI with options to open any file for reading ( and displaying the file as in Project2) and one to Quit the program.You will need a FileMeu Handler classto handle the events from FileMenu. Be sure to use getAbsolutepath() when getting the file from JFileChooser, not getName(). Handle Exceptions A data file will be provided that will contain errors (eg- hours>23,minutes>59, seconds>59). Create an exception called IllegalClockException...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT