From ee445605754b2370b12f8f516d84bac1cfebbbaa Mon Sep 17 00:00:00 2001 From: Sage The DM Date: Mon, 13 Jan 2025 20:16:46 +0100 Subject: [PATCH] Help me FATHER --- .../_javafx_website_task/cart.txt | 1 + .../main/java/com/example/CartController.java | 14 ++------------ .../java/com/example/CheckOutController.java | 3 ++- .../src/main/resources/com/example/cart.fxml | 2 +- .../classes/com/example/CartController.class | Bin 4568 -> 4336 bytes .../com/example/CheckOutController.class | Bin 4468 -> 4487 bytes .../target/classes/com/example/cart.fxml | 2 +- 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/cart.txt b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/cart.txt index e04bc95..fea1ebb 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/cart.txt +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/cart.txt @@ -16,3 +16,4 @@ The Kingkiller Chronicle The Kingkiller Chronicle The Kingkiller Chronicle The Kingkiller Chronicle +The Wheel of Time diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java index bbc6f73..34965c2 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CartController.java @@ -86,17 +86,7 @@ public class CartController { } @FXML - private void handleCheckOutButton(ActionEvent event) { - if (cartItems.isEmpty()) { - System.out.println("Cart is empty. Cannot proceed to checkout."); - return; - } - - System.out.println("Proceeding to checkout..."); - try { - App.setRoot("checkOut"); - } catch (IOException e) { - e.printStackTrace(); - } + private void handleCheckOutButton(ActionEvent event) throws IOException { + App.setRoot("checkOut"); } } diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CheckOutController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CheckOutController.java index 5edfd47..d68962c 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CheckOutController.java +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/CheckOutController.java @@ -94,7 +94,7 @@ public class CheckOutController { } @FXML - private void handleSubmit(ActionEvent event) { + private void handleSubmit(ActionEvent event) throws IOException { System.out.println("Submit button clicked."); String fullName = fullNameField.getText(); @@ -115,6 +115,7 @@ public class CheckOutController { System.out.println("Form submitted successfully."); System.out.printf("Billing Info: %s, %s, %s, %s, %s\n", fullName, address, city, zip, country); System.out.printf("Credit Card Info: %s, %s, %s, CVV: %s\n", cardNumber, cardHolderName, expiryDate, cvv); + App.setRoot("shop"); } } } diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/resources/com/example/cart.fxml b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/resources/com/example/cart.fxml index 80504f2..7f4980e 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/resources/com/example/cart.fxml +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/resources/com/example/cart.fxml @@ -41,7 +41,7 @@ -