Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A reliable computer program needs to be able to deal with problems that arise at runtime due to user error or system problems. As part
A reliable computer program needs to be able to deal with problems that arise at runtime due to user error or system problems. As part of this error handling, it is helpful if the program provides information about problems and program execution that can help technical support and the development understand what is happening. Adding logging to the applications you develop for this course will help you confirm that your code is working as expected and deal with problems when it is not.
The Java logging API's Logger class provides a mechanism for troubleshooting and debugging code that is easily configurable and can provide different levels of detail about what is happening in an application. The messages logged in categories ranging from informational messages to severe error messages. The logging API includes different handlers that allow this information to be written to the console or to a file.
In this assignment, you will modify a JavaFX UI and use Java logging and exception handling to track and understand the behavior of a JavaFX application.
Preparation
Make sure that you have successfully downloaded and installed Java SE and NetBeans on your local machine. See the instructions in the study in Unit
Download and unzip the uaJavaFXRegisterForCourse.zip Download uaJavaFXRegisterForCourse.zipfile and then load it into the NetBeans IDE. The code provided uses the JavaFX FileChooser class.
Directions
Modify the JavaFX program provided in the zip file by using Java logging and exception handling to track the behavior of the course registration application.
The application reads its course data from a text file called course.data.txt found in the included in the zip file so you will need to configure the JavaFX file chooser to show only files with txt file extensions.
Use the code provided in the uaJavaFXRegisterForCourse.zip file. Start by completing the configureFileChooser method that configures the FileChooser control.
Next, add logging using a FileHandler object that writes the log entries to a file in the user's home directory. The program should log events as part of exception handling and tracing program operation at of the levels of severity that provide information about the running of the program, user errors, and exceptions.
After running and testing the program, make sure to double check the open the log files in a text editor to inspect their contents and confirm that the logging is working as expected. Submit the log file with your assignment.
Make sure you do the following:
Modify the JavaFX file chooser to show only files with a txt extension.
Use the Java logging API to record information about a program's behavior and errors at levels of severity.
Code exception handling to create log entries that accurately document problems.
Use a logging API FileHandler to write messages to a log file.
Note: You will using this code for a later assignment ua so discuss any questions or problems with your instructor before then.
Submission Requirements
Zip up the directory structure for your completed NetBeans project uaJavaFXRegisterForCourse and submit it in the courseroom. Note: you will need this file to complete one of your later assignments.
Make sure to submit your log file.
Make sure to comment and format the source code appropriately.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started