Help me dear lord

This commit is contained in:
sageTheDM 2025-01-12 22:42:29 +01:00
parent 55b62b7b3d
commit 15468735cd
6 changed files with 67 additions and 50 deletions

View file

@ -28,7 +28,7 @@ public class App extends Application {
// Set the stage properties // Set the stage properties
stage.setScene(scene); stage.setScene(scene);
stage.setTitle("Fantasy Brigade Bookshop"); stage.setTitle("Fantasy Brigade Bookshop");
stage.setFullScreen(true); // Make the application fullscreen stage.setFullScreen(true);
stage.show(); stage.show();
} }

View file

@ -8,6 +8,8 @@ import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView; import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.control.cell.PropertyValueFactory;
import java.io.IOException;
public class CartController { public class CartController {
@FXML @FXML
@ -57,65 +59,33 @@ public class CartController {
@FXML @FXML
private void handleCartButton(ActionEvent event) { private void handleCartButton(ActionEvent event) {
System.out.println("Cart button clicked!"); 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 @FXML
private void handleLoginButton(ActionEvent event) { private void handleLoginButton(ActionEvent event) {
System.out.println("Login button clicked!"); 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 @FXML
private void handleCheckOutButton(ActionEvent event) { private void handleCheckOutButton(ActionEvent event) {
System.out.println("Checkout button clicked!"); System.out.println("Checkout button clicked!");
// Add logic to proceed to checkout // Add logic to proceed to checkout
} try {
// Navigate to the checkout page
// Inner class to represent items in the cart App.setRoot("checkout");
public static class Item { } catch (IOException e) {
private String name; e.printStackTrace();
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;
}
} }
} }

View file

@ -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;
}
}