Rewards App JavaFX Starter Code
Everything in a Sandwich Rewards App JavaFX Starter Code
Set up a project in the IDE of your choice (we recommend intelliJ) and add the following classes to your project:
- From your text-based project:
- Address.java record. We are including this code below as well.
- Reward.java record. We are including this code below as well.
- For the JavaFX version listed below:
- Customer.java: This class represents a customer in the app and has the CustomerContactInfo, customer id number, and date joined.
- CustomerContactInfo.java: This class represents a customer's first name, last name, email address, and mailing address
- RewardsApps.java: This class can be used to create a RewardsApps object, which includes a list of subscribers and available offers.This class also has a static variable for the customerID. NOTE: This is different from the text-based version of the program.
- JavaFX Controllers:
- HelloController.java: This class initializes the rewards app with the data stored in the text files and provides functionality to the registration and rewards buttons.
- RegistrateionController.java: This class provides the data that is stored in the rewards and customer data files and provides functionality for registering and changing screens.
- RewardsController.java: This class provides the data that is stored in the rewrads and customer data files and provides functionality to show the available rewards.
FXML Resources
Add the following to your resources with the code provided:
- hello-view.fxml: Provides the opening scene
- registration-view.fxml: Provides the registration scene to register new customers
- rewards-view.fxml: Provides the rewards scene to display the rewards available for a customer.
Each of these files have a line that includes something like com.example.rewardsappjavafx.HelloController
. You will need to change this to point to the folder where your controller is stored. Your change will be something like com.example.WhateverYouNamedYourProject.HelloController
.
- in hello-view.fxml it will be:
com.example.rewardsappjavafx.HelloController
- in registration-view.fxml it will be:
com.example.rewardsappjavafx.RegistrationController
- in rewards-view.fxml it will be:
com.example.rewardsappjavafx.RewardsController
Text Files Needed
In your resources, add the following:
- customers.txt: You may want to add some sample customer information to this file to start you off or you can keep this file blank and it will grow as you add customers to your app.
- rewards.txt: Add a few rewards to the text file. Each reward has a name, discount amount, and expiration date. These should be separated by a comma and there is no space between the entries. The date should be in the format: year-month-day. Here is an example reward: 10%off,0.1,2025-02-06
- In each of the three controller files, you will need to add the path to your newly created customers.txt and rewards.txt files in three separate places:
onRegisterButtonClick
, onRewardsButtonClick
, and initialize
.
Images Needed
In your resources, add the following:
Return to Missions
/**
* Represents a mailing address.
* Address contains the following information:
* - First line of the street address for the mailing address
* - Second line of the street address for the mailing address
* - city of the mailing address
* - state of the mailing address
* - zip of the mailing address
* @author Crystal Sheldon
*/
public record Address (String streetAddress1, String streetAddress2, String city, String state, String zip) {
}
import java.time.LocalDate;
/**
* Represents a reward that is available to subscribing customers.
* Rewards contain the name of the offer, the amount of discount the customer will receive, and an expiration date for using the offer.
* @author Crystal Sheldon
*/
public record Reward (String rewardName, double discount, LocalDate expirationDate) {
}
import java.time.LocalDate;
/**
* Represents the customer profiles for subscribers of the app.
* Customer contains the following information:
* - Customer Contact Information which contains the person’s first name, last name, email address, and mailing address.
* - The customer’s unique customer identification number that is assigned to them when they become a member.
* - The date in which the customer has joined.
* @author Crystal Sheldon
*/
public class Customer {
private CustomerContactInfo contactInfo;
private final int customerId;
private final LocalDate dateJoined;
/**
* Creates a Customer object.
* Customer id numbers are managed by the RewardsApp class, but store with the Customer object.
* @param contact - A CustomerContactInfo object that has the first name, last name, mailing address, and email address for a Customer
* @param date - The date that the subscriber joined the app
*/
public Customer (CustomerContactInfo contact, LocalDate date) {
contactInfo = contact;
int nextcustomerId = RewardsApps.getNextCustomerId();
customerId = nextcustomerId;
dateJoined = date;
}
/**
* Creates a Customer object.
* Customer id numbers are managed by the RewardsApp class, but store with the Customer object.
* @param contact - A CustomerContactInfo object that has the first name, last name, mailing address, and email address for a Customer
* @param date - The date that the subscriber joined the app
* @param id - The customer id for the customer
*/
protected Customer (CustomerContactInfo contact, LocalDate date, int id) {
contactInfo = contact;
dateJoined = date;
customerId = id;
}
/**
* Returns the contact information for a customer
* @return - the CustomerContactInfo which includes their first name, last name, mailing address, and email address
*/
public CustomerContactInfo getContactInfo () {
return contactInfo;
}
/**
* Returns the customer id
* @return - this subscriber's customer id number
*/
public int getCustomerId() {
return customerId;
}
/**
* Returns the date you joined the app
* @return - the date this subscriber joined the app
*/
public LocalDate getDateJoined() {
return dateJoined;
}
@Override
public String toString ()
{
return contactInfo + "\n" + customerId + " " + dateJoined;
}
}
/**
* Represents the customer contact information.
* CustomerContactInfo contains the following information:
* - The first name of the customer
* - The last name of the customer
* - The email address for this customer
* - The mailing address for this customer
* @author Crystal Sheldon
*/
public class CustomerContactInfo {
private String firstName;
private String lastName;
private String emailAddress;
private Address mailingAddress;
/**
* Creates a CustomerContactInfo object
* @param first - the value of firstName which is the first name of the customer
* @param last - the value of lastName which is the last name of the customer
* @param email - the value of emailAddress which is the customer's email address
* @param mailing - the value of mailingAddress which is the customer's mailing address
*/
public CustomerContactInfo(String first, String last, String email, Address mailing) {
firstName = first;
lastName = last;
emailAddress = email;
mailingAddress = new Address (mailing.streetAddress1(), mailing.streetAddress2(), mailing.city(),
mailing.state(), mailing.zip());
}
/**
* Returns the first name of the customer
* @return - returns firstName
*/
public String firstName() {
return firstName;
}
/**
* Returns the last name of the customer
* @return - returns lastName
*/
public String lastName() {
return lastName;
}
/**
* Returns the email address of the customer
* @return - returns emailAddress
*/
public String emailAddress() {
return emailAddress;
}
/**
* Returns the mailing address of the customer
* @return - returns mailingAddress
*/
public Address mailingAddress() {
return mailingAddress;
}
/**
* Returns a string that contains the values of the CustomerContactInfo
* @return - String that represents the value of CustomerContactInfo
*/
public String toString() {
return "CustomerContactInfo[firstName=" + firstName + ", lastName=" + lastName + ", emailAddress="
+ emailAddress + ", mailingAddress=" + mailingAddress + "]";
}
/**
* Checks to see if two CustomerContactInfo objects are equal
* @param customerContact - The CustomerContactInfo that is being compared to this CustomerContactInfo
* @return - returns true if both CustomerContactInfo objects have the same first name, last name, email address,
* and mailing address; returns false otherwise.
*/
public boolean equals(CustomerContactInfo customerContact) {
return (customerContact.firstName().equals(this.firstName()) && customerContact.lastName().equals(this.lastName()) &&
customerContact.emailAddress().equals(this.emailAddress()) && customerContact.mailingAddress().equals(this.mailingAddress()));
}
}
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.time.LocalDate;
import java.util.*;
/**
* Creates customer profiles with the following information:
* - Customer Contact Information which contains the person’s first name, last name, email address, and mailing address.
* - The customer’s unique customer identification number that is assigned to them when they become a member.
* - The date in which the customer has joined.
* Rewards are available for all customers that subscribe to the app.
* Rewards contain the name of the offer, the amount of discount the customer will receive, and an expiration date for using the offer.
* @author Crystal Sheldon
*/
public class RewardsApps {
private ArrayList<Customer> subscribers;
private ArrayList<Reward> offers;
private static int customerId = 0;
/**
* Creates a RewardsApps object and initializing both the subscribers and offers ArrayList
*/
public RewardsApps() {
subscribers = new ArrayList<>();
offers = new ArrayList<>();
}
/**
* Creates a RewardsApps object and initializes the subscribers list to the elements in list
* initializes offers to an empty ArrayList
* @param subscriberFile - A file containing all the information for each subscriber to the app
* @param offerFile - A file containing all the information for each reward being offered to the app
*/
public RewardsApps (File subscriberFile, File offerFile) {
subscribers = new ArrayList<>();
offers = new ArrayList<>();
readInSubscribers(subscriberFile);
readInOffers(offerFile);
customerId = subscribers.size();
}
/**
* Initializes subscribers with all the Customer information in the subscriberFile.
* @param subscriberFile - the file that contains the subscriber information
*/
public void readInSubscribers (File subscriberFile) {
try (Scanner fileScanner = new Scanner(subscriberFile)) {
ArrayList<String> subscriberLine = new ArrayList<String>();
while (fileScanner.hasNextLine()) {
subscriberLine.add(fileScanner.nextLine());
}
for (int index = 0; index < subscriberLine.size(); index++)
{
String line = subscriberLine.get(index);
String[] data = line.split(",");
if (data.length >= 10) {
Customer customer = new Customer(new CustomerContactInfo(data[0], data[1], data[2],
new Address(data[3], data[4], data[5], data[6], data[7])),
LocalDate.parse(data[8]), Integer.parseInt(data[9]));
subscribers.add(customer);
}
}
} catch (FileNotFoundException error) {
handleError(error);
}
}
/**
* Initializes offers with all the Reward offers in the offerFile.
* @param offerFile - the file that contains the offer information
*/
public void readInOffers (File offerFile) {
try (Scanner fileScanner = new Scanner(offerFile))
{
ArrayList<String> offersLine = new ArrayList<String>();
while (fileScanner.hasNextLine())
{
offersLine.add(fileScanner.nextLine());
}
for (int index = 0; index < offersLine.size(); index++)
{
String line = offersLine.get(index);
String[] data = line.split (",");
if (data.length >= 3)
{
Reward reward = new Reward (data[0], Double.parseDouble (data[1]), LocalDate.parse(data[2]));
offers.add(reward);
}
}
}
catch (FileNotFoundException error)
{
handleError (error);
}
}
/**
* Output about the error
* @param error - The exception that is being thrown
*/
public static void handleError(Exception error)
{
System.out.println ("The following error occurred: ");
System.out.println (error.getMessage());
}
/**
* Writes the information stored in the subscribers ArrayList to the subscriber file
* @param subscriberFile - the file that stores the subscribers' information
*/
public void backUpCustomerList (File subscriberFile) {
try {
FileWriter myWriter = new FileWriter (subscriberFile);
for (Customer customer: subscribers) {
CustomerContactInfo customerContact = customer.getContactInfo();
Address customerAddress = customerContact.mailingAddress();
String line = customerContact.firstName() + "," + customerContact.lastName() + "," + customerContact.emailAddress() + "," +
customerAddress.streetAddress1() + "," + customerAddress.streetAddress2() + "," +
customerAddress.city() + "," + customerAddress.state() + "," + customerAddress.zip() + "," +
customer.getDateJoined() + "," + customer.getCustomerId();
myWriter.write(line + "\n");
}
myWriter.close();
} catch (IOException e) {
System.out.println("An error writing to subscriber file occurred.");
}
}
/**
* Backs up the reward list by writing all Reward offers in the offers list to the rewardsFile
* @param rewardsFile - the file that stores the rewards information
*/
public void backUpRewardsList (File rewardsFile) {
try {
FileWriter myWriter = new FileWriter (rewardsFile);
for (Reward reward: offers) {
String line = reward.rewardName() + "," + reward.discount() + "," + reward.expirationDate();
myWriter.write(line + "\n");
}
myWriter.close();
} catch (IOException e) {
System.out.println("An error writing to subscriber file occurred.");
}
}
/**
* Updates the customer id to the next one available and returns it
* @return - Returns customerId
*/
public static int getNextCustomerId() {
customerId++;
return customerId;
}
/**
* Adds a new Customer to the subscriber list
* @param newCustomer - The new customer that is being added to the subscriber list
*/
public void addCustomer (Customer newCustomer) {
subscribers.add(newCustomer);
}
/**
* Removes any expired Reward objects from the offers list.
*/
public void updateOffers() {
for (int x = offers.size() - 1; x >= 0; x--) {
Reward reward = offers.get(x);
if (reward.expirationDate().isBefore(LocalDate.now())) {
offers.remove(x);
}
}
}
/**
* returns an ArrayList of Customer data that have subscribed to the app.
* @return - subscribers ArrayList of Customer
*/
public ArrayList<Customer> getSubscribers () {
return subscribers;
}
/**
* returns an ArrayList of Reward data that are offers to customers.
* @return - offers ArrayList of Reward offers
*/
public ArrayList<Reward> getOffers() {
return offers;
}
@Override
/**
* Returns a string that contains the rewards and the customer list
*/
public String toString () {
String rewardsandcustomers = "";
for (Reward reward: offers){
rewardsandcustomers += reward + "\n";
}
rewardsandcustomers += "\n";
for (Customer customer : subscribers) {
rewardsandcustomers += customer + "\n";
}
return rewardsandcustomers;
}
}
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.Button;
import javafx.stage.Stage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
public class HelloController implements Initializable {
private Label instructionText;
@FXML
private Button rewardsButton;
@FXML
private Button RegistrationButton;
private RewardsApps everythingInSandwich;
@FXML
protected void onRegisterButtonClick() throws IOException {
everythingInSandwich.backUpCustomerList(new File(//replace with the path of your own customers.txt file));
everythingInSandwich.backUpRewardsList(new File(//replace with the path of your own rewards.txt file));
Stage stage = (Stage) RegistrationButton.getScene().getWindow();
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("registration_view.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("Register for Everything In A Sandwich!");
stage.setScene(scene);
}
@FXML
public void onRewardsButtonClick() throws IOException {
everythingInSandwich.backUpCustomerList(new File(//replace with the path of your own customers.txt file));
everythingInSandwich.backUpRewardsList(new File(//replace with the path of your own rewards.txt file));
Stage stage = (Stage) rewardsButton.getScene().getWindow();
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("rewards-view.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("View your Everything In A Sandwich rewards!");
stage.setScene(scene);
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
File customersFile = new File(//replace with the path of your own customers.txt file);
File rewardFile = new File (//replace with the path of your own rewards.txt file);
everythingInSandwich = new RewardsApps(customersFile, rewardFile);
}
}
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.time.LocalDate;
import java.util.ResourceBundle;
public class RegistrationController implements Initializable {
private RewardsApps everythingInSandwich;
private Label instructionText;
@FXML
private AnchorPane registrationInfoInput;
@FXML
private Button rewardsButton;
@FXML
private Button RegistrationButton;
@FXML
private TextField stateText;
@FXML
private Button submitRegistrationButton;
@FXML
private TextField streetAddress1Text;
@FXML
private TextField streetAddress2Text;
@FXML
private TextField zipText;
@FXML
private TextField cityText;
@FXML
private TextField firstNameText;
@FXML
private TextField lastNameText;
@FXML
private Label accountSetUpLabel;
@FXML
private Label customerIdText;
@FXML
private Label customerIdLabel;
@FXML
private TextField emailAddressText;
@FXML
protected void onRegisterButtonClick() throws IOException {
everythingInSandwich.backUpCustomerList(new File(//replace with the path of your own customers.txt file));
everythingInSandwich.backUpRewardsList(new File(//replace with the path of your own rewards.txt file));
Stage stage = (Stage) RegistrationButton.getScene().getWindow();
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("registration_view.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("Register for Everything In A Sandwich!");
stage.setScene(scene);
}
@FXML
public void onRewardsButtonClick() throws IOException {
everythingInSandwich.backUpCustomerList(new File(//replace with the path of your own customers.txt file));
everythingInSandwich.backUpRewardsList(new File(//replace with the path of your own rewards.txt file));
Stage stage = (Stage) rewardsButton.getScene().getWindow();
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("rewards-view.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("View your Everything In A Sandwich rewards!");
stage.setScene(scene);
}
public void resetTextFields (){
streetAddress1Text.setText("");
streetAddress2Text.setText("");
cityText.setText("");
stateText.setText("");
zipText.setText("");
firstNameText.setText("");
lastNameText.setText("");
emailAddressText.setText("");
}
@FXML
public void onSubmitRegistrationButtonClick() {
Address myAddress = new Address (streetAddress1Text.getText(), streetAddress2Text.getText(), cityText.getText(), stateText.getText(), zipText.getText());
CustomerContactInfo customerContact = new CustomerContactInfo (firstNameText.getText(), lastNameText.getText(), emailAddressText.getText(), myAddress);
Customer customer= new Customer(customerContact, LocalDate.now());
everythingInSandwich.addCustomer (customer);
accountSetUpLabel.setVisible(true);
customerIdText.setText ("" + customer.getCustomerId());
resetTextFields();
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
File customersFile = new File(//replace with the path of your own customers.txt file);
File rewardFile = new File (//replace with the path of your own rewards.txt file);
everythingInSandwich = new RewardsApps(customersFile, rewardFile);
//read the input for the registrants from a file into the Arraylist
//read the input for the rewards from a file into the ArrayList
//do this in rewards too.
}
}
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.ResourceBundle;
public class RewardsController implements Initializable {
private Label instructionText;
@FXML
private AnchorPane registrationInfoInput;
@FXML
private Button rewardsButton;
@FXML
private Button RegistrationButton;
@FXML
private RewardsApps everythingInSandwich;
@FXML
private Label displayRewardsLabel;
@FXML
private TextField customerIdText;
@FXML
protected void onRegisterButtonClick() throws IOException {
everythingInSandwich.backUpCustomerList(new File(//replace with the path of your own customers.txt file));
everythingInSandwich.backUpRewardsList(new File(//replace with the path of your own rewards.txt file));
Stage stage = (Stage) RegistrationButton.getScene().getWindow();
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("registration_view.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("Register for Everything In A Sandwich!");
stage.setScene(scene);
}
@FXML
public void onRewardsButtonClick() throws IOException {
everythingInSandwich.backUpCustomerList(new File(//replace with the path of your own customers.txt file));
everythingInSandwich.backUpRewardsList(new File(//replace with the path of your own rewards.txt file));
Stage stage = (Stage) rewardsButton.getScene().getWindow();
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("rewards-view.fxml"));
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("View your Everything In A Sandwich rewards!");
stage.setScene(scene);
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
File customersFile = new File(//replace with the path of your own customers.txt file);
File rewardFile = new File (//replace with the path of your own rewards.txt file);
everythingInSandwich = new RewardsApps(customersFile, rewardFile);
}
public String convertRewardText (Reward reward) {
return reward.rewardName() + " Enjoy " + reward.discount() + " off your purchase. Hurry, expires " + reward.expirationDate() + "\n";
}
@FXML
public void showRewards() {
displayRewardsLabel.setText("");
everythingInSandwich.updateOffers();
ArrayList<Customer> customerList = everythingInSandwich.getSubscribers();
boolean found = false;
for (Customer customer : customerList) {
if (customer.getCustomerId() == Integer.parseInt(customerIdText.getText())) {
found = true;
}
}
Reward offer = null;
if (found) {
ArrayList<Reward> rewardList = everythingInSandwich.getOffers();
if (!rewardList.isEmpty()) {
String rewardsText = "";
for (Reward reward : rewardList) {
rewardsText += convertRewardText(reward);
}
displayRewardsLabel.setText(rewardsText);
} else {
displayRewardsLabel.setText("No offers at this time");
}
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<VBox alignment="TOP_CENTER" prefHeight="764.0" prefWidth="670.0" spacing="20.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.rewardsappjavafx.HelloController">
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
<ImageView fitHeight="303.0" fitWidth="357.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@sandwichlogo.jpg" />
</image>
</ImageView>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="100.0" prefWidth="630.0">
<children>
<Button fx:id="RegistrationButton" layoutX="120.0" layoutY="60.0" onAction="#onRegisterButtonClick" text="Register" textAlignment="CENTER" />
<Button fx:id="rewardsButton" layoutX="425.0" layoutY="60.0" mnemonicParsing="false" onAction="#onRewardsButtonClick" text="Rewards" textAlignment="CENTER" />
<Label layoutX="132.0" layoutY="33.0" prefHeight="17.0" prefWidth="367.0" text="Click Register to sign-up and Rewards to see your available rewards" />
</children>
</AnchorPane>
</VBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<VBox alignment="TOP_CENTER" prefHeight="764.0" prefWidth="670.0" spacing="20.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.rewardsappweb.RegistrationController">
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
<ImageView fitHeight="321.0" fitWidth="458.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@sandwichlogohorizonatal.jpg" />
</image>
</ImageView>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="100.0" prefWidth="630.0">
<children>
<Button fx:id="RegistrationButton" layoutX="120.0" layoutY="60.0" onAction="#onRegisterButtonClick" text="Register" textAlignment="CENTER" />
<Button fx:id="rewardsButton" layoutX="425.0" layoutY="60.0" mnemonicParsing="false" onAction="#onRewardsButtonClick" text="Rewards" textAlignment="CENTER" />
<Label layoutX="120.0" layoutY="29.0" prefHeight="17.0" prefWidth="362.0" text="Click Register to sign-up and Rewards to see your available rewards" />
</children>
</AnchorPane>
<AnchorPane fx:id="registrationInfoInput" prefHeight="250.0" prefWidth="200.0">
<children>
<TextField fx:id="firstNameText" layoutX="41.0" layoutY="22.0" prefHeight="25.0" prefWidth="228.0" promptText="First Name" />
<TextField fx:id="lastNameText" layoutX="315.0" layoutY="22.0" prefHeight="25.0" prefWidth="271.0" promptText="Last Name" />
<TextField fx:id="streetAddress1Text" layoutX="41.0" layoutY="63.0" prefHeight="25.0" prefWidth="541.0" promptText="Street Address 1" />
<TextField fx:id="streetAddress2Text" layoutX="41.0" layoutY="100.0" prefHeight="25.0" prefWidth="541.0" promptText="Street Address 2" />
<TextField fx:id="cityText" layoutX="41.0" layoutY="142.0" prefHeight="25.0" prefWidth="307.0" promptText="City" />
<TextField fx:id="stateText" layoutX="362.0" layoutY="142.0" prefHeight="25.0" prefWidth="51.0" promptText="State" />
<TextField fx:id="zipText" layoutX="437.0" layoutY="142.0" promptText="Zip" />
<TextField fx:id="emailAddressText" layoutX="41.0" layoutY="191.0" prefHeight="25.0" prefWidth="541.0" promptText="Email" />
</children>
</AnchorPane>
<AnchorPane fx:id="customIdPane" prefHeight="200.0" prefWidth="200.0">
<children>
<Label fx:id="accountSetUpLabel" layoutX="276.0" layoutY="76.0" prefHeight="25.0" prefWidth="338.0" text="CONGRATULATION! You have set up your account!" visible="false">
<font>
<Font size="14.0" />
</font>
</Label>
<Label fx:id="customerIdLabel" layoutX="39.0" layoutY="89.0" prefHeight="27.0" prefWidth="78.0" text="Customer Id: " />
<Label fx:id="customerIdText" layoutX="360.0" layoutY="115.0" prefHeight="27.0" prefWidth="78.0" />
<Button fx:id="submitRegistrationButton" layoutX="534.0" layoutY="22.0" mnemonicParsing="false" onAction="#onSubmitRegistrationButtonClick" text="Submit" />
</children>
</AnchorPane>
</VBox>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<VBox alignment="CENTER" prefHeight="764.0" prefWidth="670.0" spacing="20.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.rewardsappweb.RewardsController">
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
<ImageView fitHeight="321.0" fitWidth="458.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@sandwichlogohorizonatal.jpg" />
</image>
</ImageView>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="100.0" prefWidth="600.0">
<children>
<Button fx:id="RegistrationButton" layoutX="120.0" layoutY="60.0" onAction="#onRegisterButtonClick" text="Register" textAlignment="CENTER" />
<Button fx:id="rewardsButton" layoutX="425.0" layoutY="60.0" mnemonicParsing="false" onAction="#onRewardsButtonClick" text="Rewards" textAlignment="CENTER" />
<Label layoutX="118.0" layoutY="14.0" maxHeight="-Infinity" prefHeight="17.0" prefWidth="365.0" text="Click Register to sign-up and Rewards to see your available rewards" />
</children>
</AnchorPane>
<AnchorPane fx:id="registrationInfoInput" prefHeight="200.0" prefWidth="200.0">
<children>
<TextField fx:id="customerIdText" layoutX="34.0" layoutY="36.0" prefHeight="25.0" prefWidth="280.0" promptText="Enter Your Customer Id" />
<Button layoutX="444.0" layoutY="61.0" mnemonicParsing="false" onAction="#showRewards" text="viewRewardsButton" />
</children></AnchorPane>
<AnchorPane prefHeight="200.0" prefWidth="200.0">
<children>
<Label fx:id="displayRewardsLabel" layoutX="44.0" layoutY="25.0" prefHeight="140.0" prefWidth="555.0" />
</children>
</AnchorPane>
</VBox>