diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java index 6e132cf..35457c7 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/App.java @@ -28,7 +28,7 @@ public class App extends Application { // Set the stage properties stage.setScene(scene); stage.setTitle("Fantasy Brigade Bookshop"); - stage.setFullScreen(true); // Make the application fullscreen + stage.setFullScreen(true); stage.show(); } 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 1a2d6c0..f37d7ae 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 @@ -8,6 +8,8 @@ import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.cell.PropertyValueFactory; +import java.io.IOException; + public class CartController { @FXML @@ -57,65 +59,33 @@ public class CartController { @FXML private void handleCartButton(ActionEvent event) { System.out.println("Cart button clicked!"); - // Add logic to navigate to the cart view or perform related actions + try { + // Navigate to the cart page (using the setRoot method from App) + App.setRoot("cart"); + } catch (IOException e) { + e.printStackTrace(); + } } @FXML private void handleLoginButton(ActionEvent event) { System.out.println("Login button clicked!"); - // Add logic to open the login page or dialog + try { + // Navigate to the login page + App.setRoot("login"); + } catch (IOException e) { + e.printStackTrace(); + } } @FXML private void handleCheckOutButton(ActionEvent event) { System.out.println("Checkout button clicked!"); // Add logic to proceed to checkout - } - - // Inner class to represent items in the cart - public static class Item { - private String name; - private String description; - private int quantity; - private double price; - - public Item(String name, String description, int quantity, double price) { - this.name = name; - this.description = description; - this.quantity = quantity; - this.price = price; + try { + // Navigate to the checkout page + App.setRoot("checkout"); + } catch (IOException e) { + e.printStackTrace(); } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public double getPrice() { - return price; - } - - public void setPrice(double price) { - this.price = price; - } - } } diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/Item.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/Item.java new file mode 100644 index 0000000..44c83ab --- /dev/null +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/Item.java @@ -0,0 +1,47 @@ +package com.example; + +public static class Item { + private String name; + private String description; + private int quantity; + private double price; + + public Item(String name, String description, int quantity, double price) { + this.name = name; + this.description = description; + this.quantity = quantity; + this.price = price; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } +} \ No newline at end of file diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController$Item.class b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController$Item.class deleted file mode 100644 index b594320..0000000 Binary files a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController$Item.class and /dev/null differ diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController.class b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController.class index 272559d..ac1ba26 100644 Binary files a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController.class and b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/CartController.class differ diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/Item.class b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/Item.class new file mode 100644 index 0000000..7b3df9f Binary files /dev/null and b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/Item.class differ