Objectives:JavaFXMultiple views and user interactionArrayListUML DiagramsTask: An App for Spooky SeasonIt’s that time of the year (almost..) - time for pumpkins, spice, and a few spooky...



Objectives:


  • JavaFX

  • Multiple views and user interaction

  • ArrayList

  • UML Diagrams





Task: An App for Spooky Season

It’s that time of the year (almost..) - time for pumpkins, spice, and a few spooky surprises.

Let’s make something fun to show the folks at home - a short 3-view app to have some Halloween fun!




Getting Started

To begin this lab, create a newJavaFX projectnamed according to the lab guidelines, and create the following:



  • Main.java- in the application package


  • MainController.java- in the application.controller package


  • TrickController.java- in the application.controller package


  • TreatController.java- in the application.controller package


  • Trivia.java- in the application.model package


  • Main.fxml- in the application.view package


  • Trick.fxml- in the application.view package


  • Treat.fxml- in the application.view package


Data files will be stored in adatafolder at the top of the project (this includes sample data files provided in this lab).




App Design

Your program will show a view similar to the one shown in attached fileAppView1.pngwhen the app is run. This view displays a welcome message (Happy Halloween!) and two buttons. (Note that any additional images can be “hard-coded” - no GUI components on this view need to be dynamically loaded).

This view will be theMain.fxml


When the user clicks on the Trick button, they will be taken to a second view, see attached fileAppView2.png.This view displays 1 trivia question and 3 answer buttons. It also includes a header label indicating it is the “Trick” view, and a “Home” button to return users to the previous screen.

This view will beTrick.fxml


If the user clicks on the button corresponding to the correct response, the trivia response/answer should be displayed in green below the buttons. If they choose the wrong answer, the response should be shown in red. See attached fileAppView2-example.pngfor an example of when the user chooses an incorrect response.


When the user is on the Main view and clicks on the Treat button, they will be taken to a third view, see attached fileAppView3.png. This view displays a label indicating it is the “Treat” view, and a “Home” button to return users to the previous screen. The view will display 1 randomly chosen image (sample images are provided). Each time the user chooses “Treat” from the main view, they should see a different image (with some repetition expected, of course!).

This view will beTreat.fxml


You may customize your app how ever you choose - this includes images, sizes, fonts, colors, size of the app, configuration. Love scary movies? Dia De Los Muertos? Pumpkin spice? Pick your own theme, or feel free to model it after the example provided.

Remember to ensure your app works on all display sizes. For this lab, you can do this by making your appno larger than 800x800.

The app must have the described GUI components on each view.




Model



Trivia

TheTrivia.javaclass will represent the trivia game in the “Trick” view of this app. The class Trivia will have an object method calledloadTrivia(…)which takes in a file name and stores 1 piece of trivia from that file.

Sample trivia questions, answers, and responses are provided intrivia.csv.

Triva information consists of 1 question, 3 possible answers, and 1 correct response.

We will limit the number of possible answers to any trivia question to 3 for the sake of this lab.

The loadTrivia(…) method should read in 1 randomly chosen piece of trivia each time it is called, so that the user in our app sees a different question when they choose “Trick” from the main view.


All classes in the model must always have getters and setters for all class variables. Constructors are required for all required variables in a class.


Note that the controllers in your application should

never

read files or update data. Instead, to follow MVC, the controller classes will call upon the model classes to complete these tasks.




Reminders

Always test your app thoroughly before submitting, to ensure everything is working properly.

You must export the Eclipse project, including all files & dependencies for the project (this includes images, text files, fxml, etc). Submit the zip file on Blackboard.

As always, follow the instructions on the lab guidelines.






Oct 25, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here