package com.landing_page.view;import com.landing_page.model.UserProfileData; // Import the new data modelimport javafx.animation.*;import javafx.geometry.Insets;import javafx.geometry.Pos;import javafx.scene.Scene;import javafx.scene.control.*;import javafx.scene.effect.DropShadow;import javafx.scene.image.Image;import javafx.scene.image.ImageView;import javafx.scene.layout.*;import javafx.scene.paint.Color;import javafx.scene.shape.Circle;import javafx.scene.text.Font;import javafx.scene.text.Text;import javafx.stage.FileChooser;import javafx.stage.Modality;import javafx.stage.Stage;import javafx.util.Duration;import java.io.File;// Removed 'extends Application' and 'main' method as this is a view classpublic class ProfilePage { private ImageView profileImageView; private Text userNameText; private Label userEmailText; private Label memberSinceText; private Label totalOrdersText; public void initialize(Stage stage) { System.out.println("ProfilePage: Initializing ProfilePage."); // Enhanced CSS styling (fixed rgba issues) String css = """ .root { -fx-font-family: 'Segoe UI', 'Roboto', Arial, sans-serif; } .profile-container { -fx-background-color: linear-gradient(135deg, #667eea 0%, #764ba2 100%); -fx-background-radius: 0; } .profile-card { -fx-background-color: white; -fx-background-radius: 20; -fx-effect: dropshadow(gaussian, #00000026, 20, 0, 0, 10); -fx-padding: 30; } .profile-header { -fx-background-color: linear-gradient(135deg, #667eea 0%, #764ba2 100%); -fx-background-radius: 20; -fx-padding: 30; } .user-name { -fx-font-size: 28px; -fx-font-weight: bold; -fx-fill: white; -fx-effect: dropshadow(gaussian, #0000004d, 3, 0, 0, 1); } .user-email { -fx-font-size: 16px; -fx-text-fill: #f0f0f0; } .member-info { -fx-font-size: 14px; -fx-text-fill: #e0e0e0; } .info-card { -fx-background-color: white; -fx-background-radius: 15; -fx-effect: dropshadow(gaussian, #00000014, 10, 0, 0, 5); -fx-padding: 20; -fx-border-color: #667eea1a; -fx-border-radius: 15; -fx-border-width: 1; } .card-title { -fx-font-size: 18px; -fx-font-weight: bold; -fx-text-fill: #2c3e50; } .card-content { -fx-font-size: 14px; -fx-text-fill: #6c757d; } .primary-button { -fx-background-color: linear-gradient(135deg, #667eea 0%, #764ba2 100%); -fx-text-fill: white; -fx-font-size: 14px; -fx-font-weight: bold; -fx-background-radius: 25; -fx-padding: 12 24; -fx-cursor: hand; -fx-effect: dropshadow(gaussian, #667eea4d, 8, 0, 0, 4); } .secondary-button { -fx-background-color: transparent; -fx-text-fill: #667eea; -fx-font-size: 14px; -fx-font-weight: bold; -fx-background-radius: 25; -fx-border-color: #667eea; -fx-border-radius: 25; -fx-border-width: 2; -fx-padding: 12 24; -fx-cursor: hand; } .secondary-button:hover { -fx-background-color: #667eea; -fx-text-fill: white; } .success-button { -fx-background-color: linear-gradient(135deg, #48bb78 0%, #38a169 100%); -fx-text-fill: white; -fx-font-size: 14px; -fx-font-weight: bold; -fx-background-radius: 25; -fx-padding: 12 24; -fx-cursor: hand; -fx-effect: dropshadow(gaussian, #48bb784d, 8, 0, 0, 4); } .danger-button { -fx-background-color: linear-gradient(135deg, #f56565 0%, #e53e3e 100%); -fx-text-fill: white; -fx-font-size: 14px; -fx-font-weight: bold; -fx-background-radius: 25; -fx-padding: 12 24; -fx-cursor: hand; -fx-effect: dropshadow(gaussian, #f565654d, 8, 0, 0, 4); } .stats-card { -fx-background-color: #fffffef2; -fx-background-radius: 15; -fx-padding: 20; -fx-effect: dropshadow(gaussian, #0000001a, 10, 0, 0, 5); } .stats-number { -fx-font-size: 24px; -fx-font-weight: bold; -fx-text-fill: #667eea; } .stats-label { -fx-font-size: 12px; -fx-text-fill: #6c757d; -fx-font-weight: 500; } """; // Main container VBox root = new VBox(); root.getStyleClass().add("profile-container"); // Header section with profile info VBox headerSection = createProfileHeader(); // Stats section HBox statsSection = createStatsSection(); // Info cards section VBox infoSection = createInfoSection(); // Action buttons section HBox buttonSection = createButtonSection(stage); // Main content card VBox contentCard = new VBox(30); contentCard.getStyleClass().add("profile-card"); contentCard.setAlignment(Pos.CENTER); contentCard.setMaxWidth(600); contentCard.getChildren().addAll(statsSection, infoSection, buttonSection); // Layout VBox mainContent = new VBox(40); mainContent.setAlignment(Pos.CENTER); mainContent.setPadding(new Insets(40)); mainContent.getChildren().addAll(headerSection, contentCard); ScrollPane scrollPane = new ScrollPane(mainContent); scrollPane.setFitToWidth(true); scrollPane.setStyle("-fx-background-color: transparent;"); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); Scene scene = new Scene(scrollPane, 700, 900); scene.getStylesheets().add("data:text/css;base64," + java.util.Base64.getEncoder().encodeToString(css.getBytes())); stage.setTitle("User Profile - WearShare"); stage.setScene(scene); stage.show(); // Ensure stage is shown System.out.println("ProfilePage: Scene set on stage."); // Add entrance animations addEntranceAnimations(headerSection, contentCard); } private VBox createProfileHeader() { // Profile image with enhanced styling StackPane profilePicPane = new StackPane(); profileImageView = new ImageView(); updateProfileImage(); // Use data from UserProfileData profileImageView.setFitWidth(140); profileImageView.setFitHeight(140); // Circular clip Circle clip = new Circle(70, 70, 70); profileImageView.setClip(clip); // Add border effect Circle border = new Circle(70, 70, 75); border.setFill(Color.TRANSPARENT); border.setStroke(Color.WHITE); border.setStrokeWidth(5); border.setEffect(new DropShadow(10, Color.web("#0000004d"))); // Edit button with better styling Button editBtn = new Button("📷"); editBtn.setStyle("-fx-background-color: white; -fx-background-radius: 50%; -fx-text-fill: #667eea; -fx-font-size: 16px; -fx-padding: 8; -fx-effect: dropshadow(gaussian, #00000033, 5, 0, 0, 2);"); editBtn.setOnAction(e -> openEnhancedEditDialog(profilePicPane.getScene().getWindow())); StackPane.setAlignment(editBtn, Pos.BOTTOM_RIGHT); StackPane.setMargin(editBtn, new Insets(0, 5, 5, 0)); profilePicPane.getChildren().addAll(border, profileImageView, editBtn); // User info userNameText = new Text(UserProfileData.getName()); // Use data from UserProfileData userNameText.getStyleClass().add("user-name"); userEmailText = new Label(UserProfileData.getEmail()); // Use data from UserProfileData userEmailText.getStyleClass().add("user-email"); memberSinceText = new Label("Member since " + UserProfileData.getMemberSince()); // Use data from UserProfileData memberSinceText.getStyleClass().add("member-info"); // Verified badge HBox badgeBox = new HBox(10); badgeBox.setAlignment(Pos.CENTER); Label verifiedBadge = new Label("✓ Verified"); verifiedBadge.setStyle("-fx-background-color: #ffffff33; -fx-text-fill: white; -fx-background-radius: 15; -fx-padding: 5 12; -fx-font-size: 12px; -fx-font-weight: bold;"); Label premiumBadge = new Label("⭐ Premium"); premiumBadge.setStyle("-fx-background-color: #ffd700e6; -fx-text-fill: #2c3e50; -fx-background-radius: 15; -fx-padding: 5 12; -fx-font-size: 12px; -fx-font-weight: bold;"); badgeBox.getChildren().addAll(verifiedBadge, premiumBadge); VBox headerContent = new VBox(15); headerContent.setAlignment(Pos.CENTER); headerContent.getChildren().addAll(profilePicPane, userNameText, userEmailText, memberSinceText, badgeBox); VBox headerSection = new VBox(headerContent); headerSection.getStyleClass().add("profile-header"); headerSection.setAlignment(Pos.CENTER); headerSection.setMaxWidth(600); return headerSection; } private HBox createStatsSection() { VBox ordersCard = createStatsCard(String.valueOf(UserProfileData.getTotalOrders()), "Total Orders", "📦"); // Use data from UserProfileData // Removed Wishlist Card // VBox wishlistCard = createStatsCard("8", "Wishlist Items", "❤️"); VBox reviewsCard = createStatsCard("4.8", "Avg Rating", "⭐"); VBox savingsCard = createStatsCard("₹2,450", "Total Savings", "💰"); HBox statsSection = new HBox(20); statsSection.setAlignment(Pos.CENTER); statsSection.getChildren().addAll(ordersCard, reviewsCard, savingsCard); // Removed wishlistCard return statsSection; } private VBox createStatsCard(String number, String label, String icon) { Label iconLabel = new Label(icon); iconLabel.setStyle("-fx-font-size: 24px;"); Label numberLabel = new Label(number); numberLabel.getStyleClass().add("stats-number"); Label textLabel = new Label(label); textLabel.getStyleClass().add("stats-label"); textLabel.setWrapText(true); textLabel.setMaxWidth(80); VBox card = new VBox(8); card.setAlignment(Pos.CENTER); card.getStyleClass().add("stats-card"); card.setPrefWidth(120); card.getChildren().addAll(iconLabel, numberLabel, textLabel); addHoverAnimation(card); return card; } private VBox createInfoSection() { VBox infoSection = new VBox(20); infoSection.setAlignment(Pos.CENTER); infoSection.getChildren().addAll( createEnhancedCard("📋 Order History", "View your recent orders and track deliveries", UserProfileData.getTotalOrders() + " completed orders"), // Use data from UserProfileData // Removed Wishlist Card // createEnhancedCard("❤️ Wishlist", "Save your favorite outfits for later", "8 items saved"), createEnhancedCard("📍 Addresses", "Manage your delivery addresses", "2 saved addresses") // Removed Payment Methods Card // createEnhancedCard("💳 Payment Methods", "Manage your payment options", "1 card saved") ); return infoSection; } private VBox createEnhancedCard(String title, String description, String status) { Label titleLabel = new Label(title); titleLabel.getStyleClass().add("card-title"); Label descLabel = new Label(description); descLabel.getStyleClass().add("card-content"); descLabel.setWrapText(true); Label statusLabel = new Label(status); statusLabel.setStyle("-fx-font-size: 12px; -fx-text-fill: #667eea; -fx-font-weight: bold;"); VBox card = new VBox(8); card.getStyleClass().add("info-card"); card.setMaxWidth(500); card.getChildren().addAll(titleLabel, descLabel, statusLabel); addHoverAnimation(card); return card; } private HBox createButtonSection(Stage stage) { Button loginBtn = new Button("🔐 Login"); loginBtn.getStyleClass().add("primary-button"); Button signupBtn = new Button("✨ Sign Up"); signupBtn.getStyleClass().add("success-button"); Button logoutBtn = new Button("🚪 Logout"); logoutBtn.getStyleClass().add("danger-button"); Button backBtn = new Button("← Back to Home"); backBtn.getStyleClass().add("secondary-button"); // Add hover animations addButtonAnimation(loginBtn); addButtonAnimation(signupBtn); addButtonAnimation(logoutBtn); addButtonAnimation(backBtn); // Event handlers (maintaining original functionality) backBtn.setOnAction(e -> { System.out.println("ProfilePage: 'Back to Home' button clicked. Navigating to LandingPage."); new LandingPage().initialize(stage); }); loginBtn.setOnAction(e -> { System.out.println("ProfilePage: 'Login' button clicked. Navigating to LoginPage."); LoginPage loginPage = new LoginPage(); // Call initialize directly, not start loginPage.initialize(stage); }); signupBtn.setOnAction(e -> { System.out.println("ProfilePage: 'Sign Up' button clicked. Navigating to SignupPage."); SignupPage signupPage = new SignupPage(); // Pass the current stage to SignupPage signupPage.setSignupStage(stage); Scene signupScene = new Scene(signupPage.createScene(() -> { // Callback to return to ProfilePage after signup System.out.println("ProfilePage: Callback from SignupPage to return to ProfilePage triggered."); this.initialize(stage); // Re-initialize ProfilePage to reflect any changes or just return }), 600, 700); // Use consistent scene size signupPage.setSignupScene(signupScene); stage.setScene(signupScene); }); logoutBtn.setOnAction(e -> { Alert alert = new Alert(Alert.AlertType.CONFIRMATION); alert.setTitle("Logout Confirmation"); alert.setHeaderText("Are you sure you want to logout?"); alert.setContentText("You will need to login again to access your account."); alert.showAndWait().ifPresent(response -> { if (response == ButtonType.OK) { System.out.println("ProfilePage: Logout confirmed. Resetting user data and navigating to LandingPage."); UserProfileData.resetData(); // Reset user data on logout new LandingPage().initialize(stage); } }); }); HBox buttonBox = new HBox(15); buttonBox.setAlignment(Pos.CENTER); buttonBox.getChildren().addAll(loginBtn, signupBtn, logoutBtn, backBtn); return buttonBox; } private void openEnhancedEditDialog(javafx.stage.Window ownerStage) { Stage dialog = new Stage(); dialog.initModality(Modality.WINDOW_MODAL); dialog.initOwner(ownerStage); dialog.setTitle("Edit Profile - WearShare"); VBox dialogVBox = new VBox(20); dialogVBox.setPadding(new Insets(30)); dialogVBox.setAlignment(Pos.CENTER); dialogVBox.setStyle("-fx-background-color: white; -fx-background-radius: 15;"); // Header Label headerLabel = new Label("✏️ Edit Profile"); headerLabel.setStyle("-fx-font-size: 24px; -fx-font-weight: bold; -fx-text-fill: #2c3e50;"); // Form fields VBox formBox = new VBox(15); formBox.setAlignment(Pos.CENTER); Label nameLabel = new Label("Full Name:"); nameLabel.setStyle("-fx-font-weight: bold; -fx-text-fill: #2c3e50;"); TextField nameField = new TextField(UserProfileData.getName()); // Read from UserProfileData nameField.setPromptText("Enter your full name"); nameField.setStyle("-fx-background-radius: 8; -fx-padding: 12; -fx-font-size: 14px; -fx-border-color: #e2e8f0; -fx-border-radius: 8;"); Label emailLabel = new Label("Email Address:"); emailLabel.setStyle("-fx-font-weight: bold; -fx-text-fill: #2c3e50;"); TextField emailField = new TextField(UserProfileData.getEmail()); // Read from UserProfileData emailField.setPromptText("Enter your email"); emailField.setStyle("-fx-background-radius: 8; -fx-padding: 12; -fx-font-size: 14px; -fx-border-color: #e2e8f0; -fx-border-radius: 8;"); Label imageLabel = new Label("Profile Image:"); imageLabel.setStyle("-fx-font-weight: bold; -fx-text-fill: #2c3e50;"); HBox imageBox = new HBox(10); imageBox.setAlignment(Pos.CENTER); TextField imageUrlField = new TextField(UserProfileData.getProfileImageURL()); // Read from UserProfileData imageUrlField.setPromptText("Enter image URL"); imageUrlField.setStyle("-fx-background-radius: 8; -fx-padding: 12; -fx-font-size: 14px; -fx-border-color: #e2e8f0; -fx-border-radius: 8;"); imageUrlField.setPrefWidth(300); Button browseBtn = new Button("📁 Browse"); browseBtn.setStyle("-fx-background-color: #667eea; -fx-text-fill: white; -fx-background-radius: 8; -fx-padding: 12; -fx-font-weight: bold;"); browseBtn.setOnAction(e -> { FileChooser fileChooser = new FileChooser(); fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("Image Files", "*.png", "*.jpg", "*.jpeg", "*.gif")); File file = fileChooser.showOpenDialog(dialog); if (file != null) { imageUrlField.setText(file.toURI().toString()); } }); imageBox.getChildren().addAll(imageUrlField, browseBtn); formBox.getChildren().addAll( nameLabel, nameField, emailLabel, emailField, imageLabel, imageBox ); // Buttons HBox buttonBox = new HBox(15); buttonBox.setAlignment(Pos.CENTER); Button saveBtn = new Button("💾 Save Changes"); saveBtn.setStyle("-fx-background-color: linear-gradient(135deg, #48bb78 0%, #38a169 100%); -fx-text-fill: white; -fx-background-radius: 25; -fx-padding: 12 24; -fx-font-weight: bold; -fx-cursor: hand;"); Button cancelBtn = new Button("❌ Cancel"); cancelBtn.setStyle("-fx-background-color: transparent; -fx-text-fill: #6c757d; -fx-background-radius: 25; -fx-border-color: #6c757d; -fx-border-radius: 25; -fx-padding: 12 24; -fx-font-weight: bold; -fx-cursor: hand;"); addButtonAnimation(saveBtn); addButtonAnimation(cancelBtn); saveBtn.setOnAction(e -> { UserProfileData.setName(nameField.getText().trim()); // Update UserProfileData UserProfileData.setEmail(emailField.getText().trim()); // Update UserProfileData UserProfileData.setProfileImageURL(imageUrlField.getText().trim()); // Update UserProfileData updateProfile(); // Refresh UI with new data // Success animation Alert successAlert = new Alert(Alert.AlertType.INFORMATION); successAlert.setTitle("Success"); successAlert.setHeaderText("Profile Updated!"); successAlert.setContentText("Your profile has been successfully updated."); successAlert.showAndWait(); dialog.close(); }); cancelBtn.setOnAction(e -> dialog.close()); buttonBox.getChildren().addAll(saveBtn, cancelBtn); dialogVBox.getChildren().addAll(headerLabel, formBox, buttonBox); Scene dialogScene = new Scene(dialogVBox, 450, 500); dialog.setScene(dialogScene); dialog.show(); // Add entrance animation FadeTransition fadeIn = new FadeTransition(Duration.millis(300), dialogVBox); fadeIn.setFromValue(0); fadeIn.setToValue(1); fadeIn.play(); } private void updateProfile() { userNameText.setText(UserProfileData.getName()); userEmailText.setText(UserProfileData.getEmail()); updateProfileImage(); // Add update animation ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(200), userNameText); scaleTransition.setFromX(1.0); scaleTransition.setFromY(1.0); scaleTransition.setToX(1.1); scaleTransition.setToY(1.1); scaleTransition.setAutoReverse(true); scaleTransition.setCycleCount(2); scaleTransition.play(); } private void updateProfileImage() { try { Image newImage = new Image(UserProfileData.getProfileImageURL(), true); profileImageView.setImage(newImage); } catch (Exception e) { System.out.println("ProfilePage: Invalid image URL, using default."); Image defaultImage = new Image("https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&q=80"); profileImageView.setImage(defaultImage); } } private void addHoverAnimation(Region node) { ScaleTransition scaleIn = new ScaleTransition(Duration.millis(200), node); scaleIn.setToX(1.02); scaleIn.setToY(1.02); ScaleTransition scaleOut = new ScaleTransition(Duration.millis(200), node); scaleOut.setToX(1.0); scaleOut.setToY(1.0); node.setOnMouseEntered(e -> scaleIn.play()); node.setOnMouseExited(e -> scaleOut.play()); } private void addButtonAnimation(Button button) { ScaleTransition scaleIn = new ScaleTransition(Duration.millis(100), button); scaleIn.setToX(1.05); scaleIn.setToY(1.05); ScaleTransition scaleOut = new ScaleTransition(Duration.millis(100), button); scaleOut.setToX(1.0); scaleOut.setToY(1.0); button.setOnMousePressed(e -> scaleIn.play()); button.setOnMouseReleased(e -> scaleOut.play()); } private void addEntranceAnimations(Region... nodes) { for (int i = 0; i < nodes.length; i++) { Region node = nodes[i]; // Initial state node.setOpacity(0); node.setTranslateY(30); // Animation FadeTransition fadeTransition = new FadeTransition(Duration.millis(600), node); fadeTransition.setFromValue(0); fadeTransition.setToValue(1); TranslateTransition translateTransition = new TranslateTransition(Duration.millis(600), node); translateTransition.setFromY(30); translateTransition.setToY(0); ParallelTransition parallelTransition = new ParallelTransition(fadeTransition, translateTransition); parallelTransition.setDelay(Duration.millis(i * 300)); parallelTransition.play(); } }}when click then the scene srink dont want that to happen fix the error
You're right, the scene shrinking is likely happening because the LoginPage and SignupPage are being initialized with fixed scene dimensions, overriding the current stage size. To fix this, we need to ensure that when navigating to these pages, they inherit or use the current stage's dimensions.
Since I don't have the code for LoginPage.java and SignupPage.java, I'll provide QuickEdit instructions for ProfilePage.java and then suggest how you should modify LoginPage.java and SignupPage.java to accept and use the current stage's dimensions.
Here's how to fix ProfilePage.java:
Next Steps: Update LoginPage.java and SignupPage.java
To fully resolve the shrinking issue, you'll need to modify LoginPage.java and SignupPage.java to accept and use the width and height parameters when setting their scenes.
For LoginPage.java (assuming its structure):
com/landing_page/view/LoginPage.java
For SignupPage.java (assuming its structure):
com/landing_page/view/SignupPage.java
By making these changes, the LoginPage and SignupPage will adapt to the current size of the main stage, preventing the scene from shrinking unexpectedly.
package com.landing_page.view;import javafx.geometry.Insets;import javafx.geometry.Pos;import javafx.scene.Scene;import javafx.scene.control.Button;import javafx.scene.control.Label;import javafx.scene.control.ScrollPane;import javafx.scene.image.Image;import javafx.scene.image.ImageView;import javafx.scene.layout.*;import javafx.scene.paint.Color;import javafx.scene.shape.Circle;import javafx.scene.text.Font;import javafx.scene.text.FontWeight;import javafx.scene.text.Text;import javafx.scene.text.TextAlignment;import javafx.stage.Stage;public class AboutUsPage { public void initialize(Stage mystage) { BorderPane root = new BorderPane(); root.setStyle("-fx-background-color: linear-gradient(to bottom right, #e0f2f7, #bbdefb);"); // ===== Navigation Bar ===== HBox navBar = new HBox(20); navBar.setPadding(new Insets(10, 20, 10, 20)); navBar.setAlignment(Pos.CENTER_LEFT); navBar.setStyle("-fx-background-color: #1976d2;"); Button homeBtn = new Button("Home"); Button aboutUsBtn = new Button("About Us"); Button contactBtn = new Button("Contact"); homeBtn.setStyle("-fx-background-color: white; -fx-text-fill: #1976d2; -fx-font-weight: bold;"); aboutUsBtn.setStyle("-fx-background-color: #bbdefb; -fx-text-fill: #0d47a1; -fx-font-weight: bold;"); contactBtn.setStyle("-fx-background-color: white; -fx-text-fill: #1976d2; -fx-font-weight: bold;"); // Navigation actions homeBtn.setOnAction(e -> { LandingPage landingPage = new LandingPage(); landingPage.initialize(mystage); }); // contactBtn.setOnAction(e -> { // ContactPage contactPage = new ContactPage(); // contactPage.initialize(mystage); // }); aboutUsBtn.setOnAction(e -> { AboutUsPage aboutUsPage = new AboutUsPage(); Stage mystage1 = (Stage) ((Button) e.getSource()).getScene().getWindow(); aboutUsPage.initialize(mystage1); }); navBar.getChildren().addAll(homeBtn, aboutUsBtn, contactBtn); root.setTop(navBar); // ===== Main Content ===== VBox card = new VBox(20); card.setAlignment(Pos.TOP_CENTER); card.setPadding(new Insets(30, 50, 30, 50)); card.setMaxWidth(1500); card.setStyle( "-fx-background-color: rgba(255, 255, 255, 0.95);" + "-fx-background-radius: 25;" + "-fx-border-radius: 25;" + "-fx-border-color: #ffffff;" + "-fx-border-width: 2;" + "-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.15), 40, 0.1, 0, 10);" ); Label title = new Label("About Our Project"); title.setFont(Font.font("Segoe UI", FontWeight.BOLD, 42)); title.setTextFill(Color.web("#2c3e50")); Label projectDesc = new Label( "We, the Core2Web students, have developed a 'WearShare' using JavaFX and MySQL. " + "This helps to rent and share your outfits with a modern UI, authorized access, and legal services." ); projectDesc.setFont(Font.font("Segoe UI", 18)); projectDesc.setTextFill(Color.web("#34495e")); projectDesc.setWrapText(true); projectDesc.setTextAlignment(TextAlignment.CENTER); projectDesc.setMaxWidth(750); Label classLabel = new Label("Our Institute - Core2Web"); classLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 28)); classLabel.setTextFill(Color.web("#2980b9")); HBox clasBox = new HBox(20); clasBox.setAlignment(Pos.CENTER); ImageView logo = new ImageView(new Image("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTsfhnqJshiRhlC0Bx_o5A28Y1LBf-f-IM6UA&s")); logo.setFitWidth(190); logo.setFitHeight(190); logo.setPreserveRatio(true); Label classDesc = new Label( "Core2Web is renowned for its real-world coding sessions, dedicated mentors, " + "and hands-on project building, shaping students into job-ready professionals." ); classDesc.setFont(Font.font("Segoe UI", 17)); classDesc.setWrapText(true); classDesc.setTextFill(Color.web("#34495e")); classDesc.setMaxWidth(500); classDesc.setTextAlignment(TextAlignment.LEFT); clasBox.getChildren().addAll(logo, classDesc); Label sirLabel = new Label("Special Thanks to Shashi Sir"); sirLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 28)); sirLabel.setTextFill(Color.web("#2980b9")); HBox sirBox = new HBox(20); sirBox.setAlignment(Pos.CENTER); ImageView sirImage = new ImageView(new Image("https://www.core2web.in/assets/images/landing/ShashiSirMobile.png")); sirImage.setFitWidth(250); sirImage.setFitHeight(250); sirImage.setPreserveRatio(true); Label sirDesc = new Label( "I extend my heartfelt gratitude to Shashi Sir for his exceptional teaching approach, " + "which has made learning both easier and enjoyable. The practical sessions and projects " + "from the Core2Web team have significantly boosted my confidence." ); sirDesc.setFont(Font.font("Segoe UI", 17)); sirDesc.setWrapText(true); sirDesc.setTextFill(Color.web("#34495e")); sirDesc.setMaxWidth(500); sirDesc.setTextAlignment(TextAlignment.LEFT); sirBox.getChildren().addAll(sirImage, sirDesc); Label mentorLabel = new Label("Project Mentors"); mentorLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 28)); mentorLabel.setTextFill(Color.web("#2980b9")); Label mentors = new Label("Sachin Sir, Pramod Sir, Shiv Sir, Subodh Sir, Akshay Sir"); mentors.setFont(Font.font("Segoe UI", FontWeight.BOLD, 20)); mentors.setTextFill(Color.web("#2c3e50")); Label mentorDesc = new Label( "Guided us throughout the project with strong technical support and mentorship." ); mentorDesc.setFont(Font.font("Segoe UI", 17)); mentorDesc.setWrapText(true); mentorDesc.setTextFill(Color.web("#34495e")); mentorDesc.setTextAlignment(TextAlignment.CENTER); mentorDesc.setMaxWidth(750); Label teamLead = new Label("Team Leader"); teamLead.setFont(Font.font("Segoe UI", FontWeight.BOLD, 20)); teamLead.setTextFill(Color.web("#2980b9")); Label teamLeaderDesc = new Label( "Vedant Mahajan led us through the development of the WearShare with clear vision and dedication." ); teamLeaderDesc.setFont(Font.font("Segoe UI", 16)); teamLeaderDesc.setWrapText(true); teamLeaderDesc.setTextFill(Color.web("#2d3436")); teamLeaderDesc.setTextAlignment(TextAlignment.CENTER); Label teamLabel = new Label("Our Dedicated Team"); teamLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 20)); teamLabel.setTextFill(Color.web("#2980b9")); HBox memberName = new HBox(70); memberName.setAlignment(Pos.CENTER); Text Prasad = new Text("Prasad Kumbhar"); Text Ashitosh = new Text("Ashitosh More"); Text Vaibhav = new Text("Vaibhav Dixit"); Text Sahil = new Text("Sahil Sansole"); Prasad.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); Ashitosh.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); Vaibhav.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); Sahil.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); memberName.getChildren().addAll(Prasad, Ashitosh, Vaibhav, Sahil); card.getChildren().addAll( title, projectDesc, classLabel, clasBox, sirLabel, sirBox, mentorLabel, mentors, mentorDesc, teamLead, teamLeaderDesc, teamLabel, memberName ); ScrollPane scrollPane = new ScrollPane(card); scrollPane.setFitToWidth(true); scrollPane.setStyle("-fx-background-color: transparent;"); scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); StackPane contentHolder = new StackPane(scrollPane); contentHolder.setPadding(new Insets(15)); root.setCenter(contentHolder); Scene scene = new Scene(root, 1550, 800); mystage.setTitle("About Us - WearShare"); mystage.setScene(scene); mystage.show(); } private ImageView createCircularImageView(String imagePath, double size) { ImageView iv = new ImageView(new Image(imagePath)); iv.setFitWidth(size); iv.setFitHeight(size); Circle clip = new Circle(size / 2, size / 2, size / 2); iv.setClip(clip); iv.setStyle("-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.3), 15, 0.4, 0, 4);"); return iv; }}package com.landing_page.view;import javafx.geometry.Insets;import javafx.geometry.Pos;import javafx.scene.Scene;import javafx.scene.control.Button;import javafx.scene.control.Label;import javafx.scene.control.ScrollPane;import javafx.scene.image.Image;import javafx.scene.image.ImageView;import javafx.scene.layout.*;import javafx.scene.paint.Color;import javafx.scene.shape.Circle;import javafx.scene.text.Font;import javafx.scene.text.FontWeight;import javafx.scene.text.Text;import javafx.scene.text.TextAlignment;import javafx.stage.Stage;public class AboutUsPage { public void initialize(Stage mystage) { BorderPane root = new BorderPane(); root.setStyle("-fx-background-color: linear-gradient(to bottom right, #e0f2f7, #bbdefb);"); // ===== Navigation Bar ===== HBox navBar = new HBox(20); navBar.setPadding(new Insets(10, 20, 10, 20)); navBar.setAlignment(Pos.CENTER_LEFT); navBar.setStyle("-fx-background-color: #1976d2;"); Button homeBtn = new Button("Home"); Button aboutUsBtn = new Button("About Us"); Button contactBtn = new Button("Contact"); homeBtn.setStyle("-fx-background-color: white; -fx-text-fill: #1976d2; -fx-font-weight: bold;"); aboutUsBtn.setStyle("-fx-background-color: #bbdefb; -fx-text-fill: #0d47a1; -fx-font-weight: bold;"); contactBtn.setStyle("-fx-background-color: white; -fx-text-fill: #1976d2; -fx-font-weight: bold;"); // Navigation actions homeBtn.setOnAction(e -> { LandingPage landingPage = new LandingPage(); landingPage.initialize(mystage); }); // contactBtn.setOnAction(e -> { // ContactPage contactPage = new ContactPage(); // contactPage.initialize(mystage); // }); aboutUsBtn.setOnAction(e -> { AboutUsPage aboutUsPage = new AboutUsPage(); Stage mystage1 = (Stage) ((Button) e.getSource()).getScene().getWindow(); aboutUsPage.initialize(mystage1); }); navBar.getChildren().addAll(homeBtn, aboutUsBtn, contactBtn); root.setTop(navBar); // ===== Main Content ===== VBox card = new VBox(20); card.setAlignment(Pos.TOP_CENTER); card.setPadding(new Insets(30, 50, 30, 50)); card.setMaxWidth(1500); card.setStyle( "-fx-background-color: rgba(255, 255, 255, 0.95);" + "-fx-background-radius: 25;" + "-fx-border-radius: 25;" + "-fx-border-color: #ffffff;" + "-fx-border-width: 2;" + "-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.15), 40, 0.1, 0, 10);" ); Label title = new Label("About Our Project"); title.setFont(Font.font("Segoe UI", FontWeight.BOLD, 42)); title.setTextFill(Color.web("#2c3e50")); Label projectDesc = new Label( "We, the Core2Web students, have developed a 'WearShare' using JavaFX and MySQL. " + "This helps to rent and share your outfits with a modern UI, authorized access, and legal services." ); projectDesc.setFont(Font.font("Segoe UI", 18)); projectDesc.setTextFill(Color.web("#34495e")); projectDesc.setWrapText(true); projectDesc.setTextAlignment(TextAlignment.CENTER); projectDesc.setMaxWidth(750); Label classLabel = new Label("Our Institute - Core2Web"); classLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 28)); classLabel.setTextFill(Color.web("#2980b9")); HBox clasBox = new HBox(20); clasBox.setAlignment(Pos.CENTER); ImageView logo = new ImageView(new Image("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTsfhnqJshiRhlC0Bx_o5A28Y1LBf-f-IM6UA&s")); logo.setFitWidth(190); logo.setFitHeight(190); logo.setPreserveRatio(true); Label classDesc = new Label( "Core2Web is renowned for its real-world coding sessions, dedicated mentors, " + "and hands-on project building, shaping students into job-ready professionals." ); classDesc.setFont(Font.font("Segoe UI", 17)); classDesc.setWrapText(true); classDesc.setTextFill(Color.web("#34495e")); classDesc.setMaxWidth(500); classDesc.setTextAlignment(TextAlignment.LEFT); clasBox.getChildren().addAll(logo, classDesc); Label sirLabel = new Label("Special Thanks to Shashi Sir"); sirLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 28)); sirLabel.setTextFill(Color.web("#2980b9")); HBox sirBox = new HBox(20); sirBox.setAlignment(Pos.CENTER); ImageView sirImage = new ImageView(new Image("https://www.core2web.in/assets/images/landing/ShashiSirMobile.png")); sirImage.setFitWidth(250); sirImage.setFitHeight(250); sirImage.setPreserveRatio(true); Label sirDesc = new Label( "I extend my heartfelt gratitude to Shashi Sir for his exceptional teaching approach, " + "which has made learning both easier and enjoyable. The practical sessions and projects " + "from the Core2Web team have significantly boosted my confidence." ); sirDesc.setFont(Font.font("Segoe UI", 17)); sirDesc.setWrapText(true); sirDesc.setTextFill(Color.web("#34495e")); sirDesc.setMaxWidth(500); sirDesc.setTextAlignment(TextAlignment.LEFT); sirBox.getChildren().addAll(sirImage, sirDesc); Label mentorLabel = new Label("Project Mentors"); mentorLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 28)); mentorLabel.setTextFill(Color.web("#2980b9")); Label mentors = new Label("Sachin Sir, Pramod Sir, Shiv Sir, Subodh Sir, Akshay Sir"); mentors.setFont(Font.font("Segoe UI", FontWeight.BOLD, 20)); mentors.setTextFill(Color.web("#2c3e50")); Label mentorDesc = new Label( "Guided us throughout the project with strong technical support and mentorship." ); mentorDesc.setFont(Font.font("Segoe UI", 17)); mentorDesc.setWrapText(true); mentorDesc.setTextFill(Color.web("#34495e")); mentorDesc.setTextAlignment(TextAlignment.CENTER); mentorDesc.setMaxWidth(750); Label teamLead = new Label("Team Leader"); teamLead.setFont(Font.font("Segoe UI", FontWeight.BOLD, 20)); teamLead.setTextFill(Color.web("#2980b9")); Label teamLeaderDesc = new Label( "Vedant Mahajan led us through the development of the WearShare with clear vision and dedication." ); teamLeaderDesc.setFont(Font.font("Segoe UI", 16)); teamLeaderDesc.setWrapText(true); teamLeaderDesc.setTextFill(Color.web("#2d3436")); teamLeaderDesc.setTextAlignment(TextAlignment.CENTER); Label teamLabel = new Label("Our Dedicated Team"); teamLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 20)); teamLabel.setTextFill(Color.web("#2980b9")); HBox memberName = new HBox(70); memberName.setAlignment(Pos.CENTER); Text Prasad = new Text("Prasad Kumbhar"); Text Ashitosh = new Text("Ashitosh More"); Text Vaibhav = new Text("Vaibhav Dixit"); Text Sahil = new Text("Sahil Sansole"); Prasad.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); Ashitosh.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); Vaibhav.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); Sahil.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); memberName.getChildren().addAll(Prasad, Ashitosh, Vaibhav, Sahil); card.getChildren().addAll( title, projectDesc, classLabel, clasBox, sirLabel, sirBox, mentorLabel, mentors, mentorDesc, teamLead, teamLeaderDesc, teamLabel, memberName ); ScrollPane scrollPane = new ScrollPane(card); scrollPane.setFitToWidth(true); scrollPane.setStyle("-fx-background-color: transparent;"); scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); StackPane contentHolder = new StackPane(scrollPane); contentHolder.setPadding(new Insets(15)); root.setCenter(contentHolder); Scene scene = new Scene(root, 1550, 800); mystage.setTitle("About Us - WearShare"); mystage.setScene(scene); mystage.show(); } private ImageView createCircularImageView(String imagePath, double size) { ImageView iv = new ImageView(new Image(imagePath)); iv.setFitWidth(size); iv.setFitHeight(size); Circle clip = new Circle(size / 2, size / 2, size / 2); iv.setClip(clip); iv.setStyle("-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.3), 15, 0.4, 0, 4);"); return iv; }}package com.landing_page.view;import javafx.geometry.Insets;import javafx.geometry.Pos;import javafx.scene.Scene;import javafx.scene.control.Button;import javafx.scene.control.Label;import javafx.scene.control.ScrollPane;import javafx.scene.image.Image;import javafx.scene.image.ImageView;import javafx.scene.layout.*;import javafx.scene.paint.Color;import javafx.scene.shape.Circle;import javafx.scene.text.Font;import javafx.scene.text.FontWeight;import javafx.scene.text.Text;import javafx.scene.text.TextAlignment;import javafx.stage.Stage;public class AboutUsPage { public void initialize(Stage mystage) { BorderPane root = new BorderPane(); root.setStyle("-fx-background-color: linear-gradient(to bottom right, #e0f2f7, #bbdefb);"); // ===== Navigation Bar ===== HBox navBar = new HBox(20); navBar.setPadding(new Insets(10, 20, 10, 20)); navBar.setAlignment(Pos.CENTER_LEFT); navBar.setStyle("-fx-background-color: #1976d2;"); Button homeBtn = new Button("Home"); Button aboutUsBtn = new Button("About Us"); Button contactBtn = new Button("Contact"); homeBtn.setStyle("-fx-background-color: white; -fx-text-fill: #1976d2; -fx-font-weight: bold;"); aboutUsBtn.setStyle("-fx-background-color: #bbdefb; -fx-text-fill: #0d47a1; -fx-font-weight: bold;"); contactBtn.setStyle("-fx-background-color: white; -fx-text-fill: #1976d2; -fx-font-weight: bold;"); // Navigation actions homeBtn.setOnAction(e -> { LandingPage landingPage = new LandingPage(); landingPage.initialize(mystage); }); // contactBtn.setOnAction(e -> { // ContactPage contactPage = new ContactPage(); // contactPage.initialize(mystage); // }); aboutUsBtn.setOnAction(e -> { AboutUsPage aboutUsPage = new AboutUsPage(); Stage mystage1 = (Stage) ((Button) e.getSource()).getScene().getWindow(); aboutUsPage.initialize(mystage1); }); navBar.getChildren().addAll(homeBtn, aboutUsBtn, contactBtn); root.setTop(navBar); // ===== Main Content ===== VBox card = new VBox(20); card.setAlignment(Pos.TOP_CENTER); card.setPadding(new Insets(30, 50, 30, 50)); card.setMaxWidth(1500); card.setStyle( "-fx-background-color: rgba(255, 255, 255, 0.95);" + "-fx-background-radius: 25;" + "-fx-border-radius: 25;" + "-fx-border-color: #ffffff;" + "-fx-border-width: 2;" + "-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.15), 40, 0.1, 0, 10);" ); Label title = new Label("About Our Project"); title.setFont(Font.font("Segoe UI", FontWeight.BOLD, 42)); title.setTextFill(Color.web("#2c3e50")); Label projectDesc = new Label( "We, the Core2Web students, have developed a 'WearShare' using JavaFX and MySQL. " + "This helps to rent and share your outfits with a modern UI, authorized access, and legal services." ); projectDesc.setFont(Font.font("Segoe UI", 18)); projectDesc.setTextFill(Color.web("#34495e")); projectDesc.setWrapText(true); projectDesc.setTextAlignment(TextAlignment.CENTER); projectDesc.setMaxWidth(750); Label classLabel = new Label("Our Institute - Core2Web"); classLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 28)); classLabel.setTextFill(Color.web("#2980b9")); HBox clasBox = new HBox(20); clasBox.setAlignment(Pos.CENTER); ImageView logo = new ImageView(new Image("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTsfhnqJshiRhlC0Bx_o5A28Y1LBf-f-IM6UA&s")); logo.setFitWidth(190); logo.setFitHeight(190); logo.setPreserveRatio(true); Label classDesc = new Label( "Core2Web is renowned for its real-world coding sessions, dedicated mentors, " + "and hands-on project building, shaping students into job-ready professionals." ); classDesc.setFont(Font.font("Segoe UI", 17)); classDesc.setWrapText(true); classDesc.setTextFill(Color.web("#34495e")); classDesc.setMaxWidth(500); classDesc.setTextAlignment(TextAlignment.LEFT); clasBox.getChildren().addAll(logo, classDesc); Label sirLabel = new Label("Special Thanks to Shashi Sir"); sirLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 28)); sirLabel.setTextFill(Color.web("#2980b9")); HBox sirBox = new HBox(20); sirBox.setAlignment(Pos.CENTER); ImageView sirImage = new ImageView(new Image("https://www.core2web.in/assets/images/landing/ShashiSirMobile.png")); sirImage.setFitWidth(250); sirImage.setFitHeight(250); sirImage.setPreserveRatio(true); Label sirDesc = new Label( "I extend my heartfelt gratitude to Shashi Sir for his exceptional teaching approach, " + "which has made learning both easier and enjoyable. The practical sessions and projects " + "from the Core2Web team have significantly boosted my confidence." ); sirDesc.setFont(Font.font("Segoe UI", 17)); sirDesc.setWrapText(true); sirDesc.setTextFill(Color.web("#34495e")); sirDesc.setMaxWidth(500); sirDesc.setTextAlignment(TextAlignment.LEFT); sirBox.getChildren().addAll(sirImage, sirDesc); Label mentorLabel = new Label("Project Mentors"); mentorLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 28)); mentorLabel.setTextFill(Color.web("#2980b9")); Label mentors = new Label("Sachin Sir, Pramod Sir, Shiv Sir, Subodh Sir, Akshay Sir"); mentors.setFont(Font.font("Segoe UI", FontWeight.BOLD, 20)); mentors.setTextFill(Color.web("#2c3e50")); Label mentorDesc = new Label( "Guided us throughout the project with strong technical support and mentorship." ); mentorDesc.setFont(Font.font("Segoe UI", 17)); mentorDesc.setWrapText(true); mentorDesc.setTextFill(Color.web("#34495e")); mentorDesc.setTextAlignment(TextAlignment.CENTER); mentorDesc.setMaxWidth(750); Label teamLead = new Label("Team Leader"); teamLead.setFont(Font.font("Segoe UI", FontWeight.BOLD, 20)); teamLead.setTextFill(Color.web("#2980b9")); Label teamLeaderDesc = new Label( "Vedant Mahajan led us through the development of the WearShare with clear vision and dedication." ); teamLeaderDesc.setFont(Font.font("Segoe UI", 16)); teamLeaderDesc.setWrapText(true); teamLeaderDesc.setTextFill(Color.web("#2d3436")); teamLeaderDesc.setTextAlignment(TextAlignment.CENTER); Label teamLabel = new Label("Our Dedicated Team"); teamLabel.setFont(Font.font("Segoe UI", FontWeight.BOLD, 20)); teamLabel.setTextFill(Color.web("#2980b9")); HBox memberName = new HBox(70); memberName.setAlignment(Pos.CENTER); Text Prasad = new Text("Prasad Kumbhar"); Text Ashitosh = new Text("Ashitosh More"); Text Vaibhav = new Text("Vaibhav Dixit"); Text Sahil = new Text("Sahil Sansole"); Prasad.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); Ashitosh.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); Vaibhav.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); Sahil.setFont(Font.font("Segoe UI", FontWeight.BOLD, 21)); memberName.getChildren().addAll(Prasad, Ashitosh, Vaibhav, Sahil); card.getChildren().addAll( title, projectDesc, classLabel, clasBox, sirLabel, sirBox, mentorLabel, mentors, mentorDesc, teamLead, teamLeaderDesc, teamLabel, memberName ); ScrollPane scrollPane = new ScrollPane(card); scrollPane.setFitToWidth(true); scrollPane.setStyle("-fx-background-color: transparent;"); scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); StackPane contentHolder = new StackPane(scrollPane); contentHolder.setPadding(new Insets(15)); root.setCenter(contentHolder); Scene scene = new Scene(root, 1550, 800); mystage.setTitle("About Us - WearShare"); mystage.setScene(scene); mystage.show(); } private ImageView createCircularImageView(String imagePath, double size) { ImageView iv = new ImageView(new Image(imagePath)); iv.setFitWidth(size); iv.setFitHeight(size); Circle clip = new Circle(size / 2, size / 2, size / 2); iv.setClip(clip); iv.setStyle("-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.3), 15, 0.4, 0, 4);"); return iv; }} enhance ui without changing functionslity
Okay, I will enhance the UI of your AboutUsPage.java to give it a more modern and visually appealing look, while ensuring all existing functionality remains unchanged. This includes updating the styling for the navigation bar, main content, and individual person cards, and organizing the team sections with hardcoded placeholder images.
Here's the updated AboutUsPage.java code:
I've applied a fresh look to the AboutUsPage with:
FlowPane for displaying multiple person cards (teachers, mentors, team members) to allow for better wrapping and spacing.createPersonCard method has been refined to create these styled cards.package com.landing_page.view;import javafx.animation.*;import javafx.geometry.Insets;import javafx.geometry.Pos;import javafx.scene.Scene;import javafx.scene.control.*;import javafx.scene.image.Image;import javafx.scene.image.ImageView;import javafx.scene.layout.*;import javafx.stage.Stage;import javafx.util.Duration;public class LandingPage { public void initialize(Stage stage) { // Enhanced CSS styling String css = """ .root { -fx-font-family: 'Segoe UI', 'Roboto', Arial, sans-serif; } .nav-button { -fx-background-color: transparent; -fx-text-fill: white; -fx-border-color: rgba(255,255,255,0.6); -fx-border-radius: 8; -fx-background-radius: 8; -fx-font-size: 13px; -fx-padding: 8 16; -fx-cursor: hand; -fx-font-weight: 500; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 3, 0, 0, 1); } .nav-button:hover { -fx-background-color: rgba(255,255,255,0.15); -fx-border-color: white; -fx-scale-x: 1.05; -fx-scale-y: 1.05; } .search-field { -fx-background-radius: 25; -fx-border-radius: 25; -fx-padding: 12 20; -fx-font-size: 14px; -fx-background-color: rgba(255,255,255,0.9); -fx-border-color: transparent; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.1), 5, 0, 0, 2); } .search-field:focused { -fx-background-color: white; -fx-effect: dropshadow(gaussian, rgba(0,123,255,0.3), 8, 0, 0, 2); } .main-title { -fx-font-size: 48px; -fx-font-weight: bold; -fx-text-fill: white; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.5), 8, 0, 0, 3); } .subtitle { -fx-font-size: 20px; -fx-text-fill: rgba(255,255,255,0.9); -fx-font-weight: 300; } .category-title { -fx-font-size: 28px; -fx-font-weight: bold; -fx-text-fill: white; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.4), 5, 0, 0, 2); } .category-button { -fx-background-color: white; -fx-background-radius: 15; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 12, 0, 0, 6); -fx-cursor: hand; } .category-button:hover { -fx-scale-x: 1.05; -fx-scale-y: 1.05; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.3), 15, 0, 0, 8); } .category-label { -fx-text-fill: #2c3e50; -fx-font-size: 16px; -fx-font-weight: bold; } .stats-card { -fx-background-color: rgba(255,255,255,0.15); -fx-background-radius: 12; -fx-padding: 20; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.1), 8, 0, 0, 2); } .stats-number { -fx-font-size: 24px; -fx-font-weight: bold; -fx-text-fill: white; } .stats-label { -fx-font-size: 14px; -fx-text-fill: rgba(255,255,255,0.8); } .about-us-button { -fx-background-color: rgba(255,255,255,0.2); -fx-text-fill: white; -fx-background-radius: 8; -fx-padding: 12 24; -fx-font-size: 14px; -fx-font-weight: bold; -fx-cursor: hand; -fx-border-color: white; -fx-border-radius: 8; } .about-us-button:hover { -fx-background-color: rgba(255,255,255,0.3); } """; // Enhanced background with gradient overlay Image bg = new Image("https://images.unsplash.com/photo-1441986300917-64674bd600d8?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80"); BackgroundImage bgImage = new BackgroundImage( bg, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, new BackgroundSize(BackgroundSize.AUTO, BackgroundSize.AUTO, false, false, true, true) ); // Enhanced Navigation Bar HBox navBar = createEnhancedNavBar(stage); // Enhanced Header Section VBox headerBox = createEnhancedHeader(); // Stats Section HBox statsSection = createStatsSection(); // Enhanced Category Section VBox categoryBox = createEnhancedCategorySection(stage); // Features Section HBox featuresSection = createFeaturesSection(); // About Us Button Button aboutUsBtn = new Button("About Us"); aboutUsBtn.getStyleClass().add("about-us-button"); addHoverAnimation(aboutUsBtn); aboutUsBtn.setOnAction(e -> { AboutUsPage aboutUsPage = new AboutUsPage(); Stage mystage = (Stage) ((Button) e.getSource()).getScene().getWindow(); aboutUsPage.initialize(mystage); }); HBox aboutUsContainer = new HBox(aboutUsBtn); aboutUsContainer.setAlignment(Pos.CENTER); aboutUsContainer.setPadding(new Insets(20, 0, 20, 0)); // Padding for spacing at the bottom // Main Content Layout VBox contentBox = new VBox(40); contentBox.getChildren().addAll(navBar, headerBox, statsSection, categoryBox, featuresSection, aboutUsContainer); // Added aboutUsContainer contentBox.setPadding(new Insets(30)); // Add gradient overlay Region overlay = new Region(); overlay.setStyle("-fx-background-color: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.1));"); StackPane backgroundStack = new StackPane(); backgroundStack.setBackground(new Background(bgImage)); backgroundStack.getChildren().addAll(overlay, contentBox); ScrollPane scrollPane = new ScrollPane(backgroundStack); scrollPane.setFitToWidth(true); scrollPane.setStyle("-fx-background-color: transparent;"); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); Scene scene = new Scene(scrollPane, 1000, 900); scene.getStylesheets().add("data:text/css;base64," + java.util.Base64.getEncoder().encodeToString(css.getBytes())); stage.setTitle("WearShare - Landing Page"); stage.setScene(scene); stage.setMinWidth(1550); stage.setMinHeight(800); stage.show(); // Add entrance animations addEntranceAnimations(navBar, headerBox, statsSection, categoryBox, featuresSection, aboutUsContainer); // Added aboutUsContainer to animations } private HBox createEnhancedNavBar(Stage stage) { HBox navBar = new HBox(20); navBar.setPadding(new Insets(20, 40, 20, 40)); navBar.setAlignment(Pos.CENTER); navBar.setStyle("-fx-background-color: rgba(0, 0, 0, 0.8); -fx-background-radius: 15;"); // Logo section Label logo = new Label("👗 WearShare"); logo.setStyle("-fx-font-size: 20px; -fx-font-weight: bold; -fx-text-fill: white;"); // Navigation buttons Button profileBtn = new Button("👤 Profile"); Button locationBtn = new Button("📍 Location"); Button dateBtn = new Button("📅 Dates"); Button cartBtn = new Button("🛒 Cart"); Button shareBtn = new Button("✨ Share Wardrobe"); dateBtn.setOnAction(e ->{ Calender calender = new Calender(); Stage dStage = (Stage) ((Button) e.getSource()).getScene().getWindow(); calender.initialize(dStage); }); for (Button btn : new Button[]{profileBtn, locationBtn, dateBtn, cartBtn, shareBtn}) { btn.getStyleClass().add("nav-button"); addHoverAnimation(btn); } // Enhanced search field TextField searchField = new TextField(); searchField.setPromptText("🔍 Search for outfits..."); searchField.setPrefWidth(320); searchField.getStyleClass().add("search-field"); // Spacer Region spacer = new Region(); HBox.setHgrow(spacer, Priority.ALWAYS); navBar.getChildren().addAll(logo, spacer, profileBtn, locationBtn, dateBtn, searchField, cartBtn, shareBtn); // Event handlers (maintaining original functionality) cartBtn.setOnAction(e -> new CartPage().initialize(stage)); locationBtn.setOnAction(e -> new LocationPage().initialize(stage)); profileBtn.setOnAction(e -> new ProfilePage().initialize(stage)); shareBtn.setOnAction(e -> { try { new ShareWardrobePage().start(stage); } catch (Exception ex) { ex.printStackTrace(); } }); // // Date picker functionality // dateBtn.setOnAction(e -> { // Stage dateStage = new Stage(); // VBox box = new VBox(15); // box.setPadding(new Insets(20)); // box.setAlignment(Pos.CENTER); // box.setStyle("-fx-background-color: white; -fx-background-radius: 10;"); // Label lbl = new Label("Select a Date:"); // lbl.setFont(Font.font("Arial", 16)); // lbl.setStyle("-fx-text-fill: #2c3e50; -fx-font-weight: bold;"); // DatePicker datePicker = new DatePicker(); // datePicker.setStyle("-fx-font-size: 14px;"); // Button okBtn = new Button("✓ Confirm"); // okBtn.setStyle("-fx-background-color: #007bff; -fx-text-fill: white; -fx-background-radius: 6; -fx-padding: 8 16; -fx-font-weight: bold;"); // okBtn.setOnAction(ev -> { // System.out.println("Selected date: " + datePicker.getValue()); // dateStage.close(); // }); // box.getChildren().addAll(lbl, datePicker, okBtn); // Scene scene1 = new Scene(box, 300, 200); // dateStage.setScene(scene1); // dateStage.setTitle("Choose Date"); // dateStage.show(); // }); return navBar; } private VBox createEnhancedHeader() { Label tagline = new Label("WELCOME TO WEARSHARE"); tagline.getStyleClass().add("main-title"); Label subtitle = new Label("Discover, Rent, and Share Your Style — Effortlessly."); subtitle.getStyleClass().add("subtitle"); // // Add animated dots // Label animatedDots = new Label("✨ ✨ ✨"); // animatedDots.setStyle("-fx-font-size: 20px; -fx-text-fill: white;"); // // Rotate animation for dots // RotateTransition rotateTransition = new RotateTransition(Duration.seconds(3), animatedDots); // rotateTransition.setByAngle(360); // rotateTransition.setCycleCount(Timeline.INDEFINITE); // rotateTransition.play(); VBox headerBox = new VBox(15, tagline, subtitle); headerBox.setAlignment(Pos.CENTER); headerBox.setPadding(new Insets(40, 20, 40, 20)); headerBox.setStyle("-fx-background-color: rgba(255,255,255,0.1); -fx-background-radius: 20; -fx-border-color: rgba(255,255,255,0.2); -fx-border-radius: 20; -fx-border-width: 1;"); return headerBox; } private HBox createStatsSection() { VBox usersCard = createStatsCard("1000+", "Happy Users", "👥"); VBox outfitsCard = createStatsCard("5000+", "Outfits Shared", "👗"); VBox citiesCard = createStatsCard("50+", "Cities Covered", "🏙️"); VBox ratingsCard = createStatsCard("4.8★", "User Rating", "⭐"); HBox statsSection = new HBox(30, usersCard, outfitsCard, citiesCard, ratingsCard); statsSection.setAlignment(Pos.CENTER); statsSection.setPadding(new Insets(20)); return statsSection; } private VBox createStatsCard(String number, String label, String icon) { Label iconLabel = new Label(icon); iconLabel.setStyle("-fx-font-size: 30px;"); Label numberLabel = new Label(number); numberLabel.getStyleClass().add("stats-number"); Label textLabel = new Label(label); textLabel.getStyleClass().add("stats-label"); VBox card = new VBox(8, iconLabel, numberLabel, textLabel); card.setAlignment(Pos.CENTER); card.getStyleClass().add("stats-card"); card.setPrefWidth(150); addHoverAnimation(card); return card; } private VBox createEnhancedCategorySection(Stage stage) { Label categoryLabel = new Label("✨ Explore Categories"); categoryLabel.getStyleClass().add("category-title"); Label categorySubtitle = new Label("Find the perfect outfit for every occasion"); categorySubtitle.setStyle("-fx-font-size: 16px; -fx-text-fill: rgba(255,255,255,0.8);"); HBox categoryButtons = new HBox(40, createEnhancedImageButton("asset\\images\\A heartwarming wedding photo, showcasing a happy couple exchanging vows, bathed in soft golden sunlight. The bride wears a flowing white gown, and the groom is in a classic black tuxedo. The background feat.jpg", "Wedding", "💒", "#e83e8c", stage), createEnhancedImageButton("asset\\images\\tradition cloths photo maharastra.jpg", "Traditional", "🏛️", "#fd7e14", stage), createEnhancedImageButton("asset\\images\\A photorealistic image of a boy wearing casual clothing, featuring a comfortable cotton t-shirt and jeans, shot in natural light with a shallow depth of field, using warm and inviting colors, in a candid, re.jpg", "Casual", "👕", "#20c997", stage), createEnhancedImageButton("asset/images/Couple Fit in Venice.jpg", "Formal", "🤵", "#6f42c1", stage) ); categoryButtons.setAlignment(Pos.CENTER); categoryButtons.setPadding(new Insets(20)); VBox categoryBox = new VBox(15, categoryLabel, categorySubtitle, categoryButtons); categoryBox.setAlignment(Pos.CENTER); categoryBox.setPadding(new Insets(30, 0, 30, 0)); return categoryBox; } private HBox createFeaturesSection() { VBox feature1 = createFeatureCard("🚀", "Fast Delivery", "Get your outfits delivered within 24 hours"); VBox feature2 = createFeatureCard("💰", "Best Prices", "Affordable rental prices for premium outfits"); VBox feature3 = createFeatureCard("🔒", "Secure Payment", "Safe and secure payment processing"); VBox feature4 = createFeatureCard("📞", "24/7 Support", "Round the clock customer support"); HBox featuresSection = new HBox(30, feature1, feature2, feature3, feature4); featuresSection.setAlignment(Pos.CENTER); featuresSection.setPadding(new Insets(20)); return featuresSection; } private VBox createFeatureCard(String icon, String title, String description) { Label iconLabel = new Label(icon); iconLabel.setStyle("-fx-font-size: 32px;"); Label titleLabel = new Label(title); titleLabel.setStyle("-fx-font-size: 16px; -fx-font-weight: bold; -fx-text-fill: white;"); Label descLabel = new Label(description); descLabel.setStyle("-fx-font-size: 12px; -fx-text-fill: rgba(255, 255, 255, 0.98); -fx-text-alignment: center;"); descLabel.setWrapText(true); descLabel.setMaxWidth(180); VBox card = new VBox(10, iconLabel, titleLabel, descLabel); card.setAlignment(Pos.CENTER); card.setPadding(new Insets(20)); card.getStyleClass().add("stats-card"); card.setPrefWidth(200); addHoverAnimation(card); return card; } private Button createEnhancedImageButton(String imageUrl, String text, String icon, String accentColor, Stage stage) { Button button = new Button(); button.setPrefSize(220, 280); button.getStyleClass().add("category-button"); try { Image image = new Image(imageUrl, true); ImageView imageView = new ImageView(image); imageView.setPreserveRatio(false); imageView.setFitWidth(220); imageView.setFitHeight(200); imageView.setStyle("-fx-background-radius: 15 15 0 0;"); // Category badge Label badge = new Label(icon); badge.setStyle("-fx-background-color: " + accentColor + "; -fx-text-fill: white; -fx-background-radius: 15; -fx-padding: 5 10; -fx-font-size: 16px;"); Label label = new Label(text); label.getStyleClass().add("category-label"); label.setAlignment(Pos.CENTER); label.setMaxWidth(Double.MAX_VALUE); VBox labelBox = new VBox(8, badge, label); labelBox.setAlignment(Pos.CENTER); labelBox.setPadding(new Insets(15, 10, 15, 10)); VBox content = new VBox(imageView, labelBox); content.setAlignment(Pos.CENTER); content.setSpacing(0); button.setGraphic(content); // Add hover effect addHoverAnimation(button); // Maintain original functionality button.setOnAction(e -> { switch (text.toLowerCase()) { case "wedding": new WeddingPage().initialize(stage); break; case "traditional": new TraditionalPage().initialize(stage); break; case "casual": new CasualPage().initialize(stage); break; case "formal": new FormalPage().initialize(stage); break; } }); } catch (Exception e) { System.err.println("Error loading image: " + imageUrl); // Fallback button Label fallbackLabel = new Label(icon + "\n" + text); fallbackLabel.setStyle("-fx-font-size: 18px; -fx-text-fill: " + accentColor + "; -fx-text-alignment: center;"); button.setGraphic(fallbackLabel); } return button; } private void addHoverAnimation(Region node) { ScaleTransition scaleIn = new ScaleTransition(Duration.millis(200), node); scaleIn.setToX(1.05); scaleIn.setToY(1.05); ScaleTransition scaleOut = new ScaleTransition(Duration.millis(200), node); scaleOut.setToX(1.0); scaleOut.setToY(1.0); node.setOnMouseEntered(e -> scaleIn.play()); node.setOnMouseExited(e -> scaleOut.play()); } private void addEntranceAnimations(Region... nodes) { for (int i = 0; i < nodes.length; i++) { Region node = nodes[i]; // Initial state node.setOpacity(0); node.setTranslateY(50); // Animation FadeTransition fadeTransition = new FadeTransition(Duration.millis(800), node); fadeTransition.setFromValue(0); fadeTransition.setToValue(1); TranslateTransition translateTransition = new TranslateTransition(Duration.millis(800), node); translateTransition.setFromY(50); translateTransition.setToY(0); ParallelTransition parallelTransition = new ParallelTransition(fadeTransition, translateTransition); parallelTransition.setDelay(Duration.millis(i * 200)); parallelTransition.play(); } }}package com.landing_page.view;import javafx.application.Platform;import javafx.concurrent.Task;import javafx.geometry.Insets;import javafx.geometry.Pos;import javafx.scene.Scene;import javafx.scene.control.*;import javafx.scene.image.Image;import javafx.scene.image.ImageView;import javafx.scene.layout.*;import javafx.stage.Stage;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.net.HttpURLConnection;import java.net.URL;import java.util.ArrayList;import java.util.List;import java.util.regex.Matcher;import java.util.regex.Pattern;public class WeddingPage { private VBox wardrobeContainer; private ProgressIndicator loadingIndicator; private List<WardrobeItem> weddingWardrobes = new ArrayList<>(); public void initialize(Stage stage) { // CSS Styling String css = """ .root { -fx-background-color: linear-gradient(to bottom, #ff6b9d, #c44569); -fx-font-family: 'Segoe UI', Arial, sans-serif; } .wedding-header { -fx-font-size: 32px; -fx-font-weight: bold; -fx-text-fill: white; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.3), 5, 0, 0, 2); } .wedding-subtitle { -fx-font-size: 16px; -fx-text-fill: rgba(255,255,255,0.9); } .wardrobe-card { -fx-background-color: white; -fx-background-radius: 15; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 12, 0, 0, 4); -fx-padding: 20; } .wardrobe-title { -fx-font-size: 20px; -fx-font-weight: bold; -fx-text-fill: #2c3e50; } .wardrobe-detail { -fx-font-size: 14px; -fx-text-fill: #6c757d; } .price-label { -fx-font-size: 18px; -fx-font-weight: bold; -fx-text-fill: #e83e8c; } .back-button { -fx-background-color: rgba(255,255,255,0.2); -fx-text-fill: white; -fx-background-radius: 8; -fx-padding: 12 24; -fx-font-size: 14px; -fx-font-weight: bold; -fx-cursor: hand; -fx-border-color: white; -fx-border-radius: 8; } .back-button:hover { -fx-background-color: rgba(255,255,255,0.3); } .go-to-cart-button { -fx-background-color: #4CAF50; /* Green color for cart button */ -fx-text-fill: white; -fx-background-radius: 8; -fx-padding: 12 24; -fx-font-size: 14px; -fx-font-weight: bold; -fx-cursor: hand; -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 5, 0, 0, 2); } .go-to-cart-button:hover { -fx-background-color: #45a049; } .wedding-badge { -fx-background-color: #e83e8c; -fx-text-fill: white; -fx-background-radius: 15; -fx-padding: 5 12; -fx-font-size: 12px; -fx-font-weight: bold; } .rent-button { -fx-background-color: #e83e8c; -fx-text-fill: white; -fx-background-radius: 8; -fx-padding: 10 20; -fx-font-size: 14px; -fx-font-weight: bold; -fx-cursor: hand; } .rent-button:hover { -fx-background-color: #c7336b; } """; // Background with wedding theme Image bg = new Image("https://images.unsplash.com/photo-1519741497674-611481863552?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80"); BackgroundImage bgImage = new BackgroundImage( bg, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, new BackgroundSize(BackgroundSize.AUTO, BackgroundSize.AUTO, false, false, true, true) ); // Header with wedding theme Label headerLabel = new Label("💒 Wedding Collection"); headerLabel.getStyleClass().add("wedding-header"); Label subtitleLabel = new Label("Discover stunning wedding outfits for your special day"); subtitleLabel.getStyleClass().add("wedding-subtitle"); VBox headerBox = new VBox(10, headerLabel, subtitleLabel); headerBox.setAlignment(Pos.CENTER); headerBox.setPadding(new Insets(30, 20, 20, 20)); headerBox.setStyle("-fx-background-color: rgba(0,0,0,0.6); -fx-background-radius: 15;"); // Back button Button backBtn = new Button("← Back to Home"); backBtn.getStyleClass().add("back-button"); backBtn.setOnAction(e -> new LandingPage().initialize(stage)); // Go to Cart button Button goToCartBtn = new Button("Go to Cart 🛒"); goToCartBtn.getStyleClass().add("go-to-cart-button"); // Set action to navigate to CartPage goToCartBtn.setOnAction(e -> new CartPage().initialize(stage)); // HBox to hold both buttons HBox buttonContainer = new HBox(20); // 20 is the spacing between buttons buttonContainer.setAlignment(Pos.CENTER); buttonContainer.getChildren().addAll(backBtn, goToCartBtn); // Wardrobe container wardrobeContainer = new VBox(20); wardrobeContainer.setPadding(new Insets(20)); wardrobeContainer.setAlignment(Pos.CENTER); // Loading indicator loadingIndicator = new ProgressIndicator(); loadingIndicator.setVisible(false); loadingIndicator.setMaxSize(60, 60); loadingIndicator.setStyle("-fx-progress-color: white;"); // Main layout with overlay background VBox overlayContent = new VBox(20); // Add the new buttonContainer instead of just backBtn overlayContent.getChildren().addAll(headerBox, buttonContainer, wardrobeContainer); overlayContent.setPadding(new Insets(20)); overlayContent.setAlignment(Pos.TOP_CENTER); overlayContent.setStyle("-fx-background-color: rgba(255,107,157,0.1);"); // Pink overlay ScrollPane scrollPane = new ScrollPane(overlayContent); scrollPane.setFitToWidth(true); scrollPane.setStyle("-fx-background-color: transparent;"); StackPane root = new StackPane(); root.setBackground(new Background(bgImage)); root.getChildren().addAll(scrollPane, loadingIndicator); Scene scene = new Scene(root, 1200, 800); scene.getStylesheets().add("data:text/css;base64," + java.util.Base64.getEncoder().encodeToString(css.getBytes())); stage.setTitle("Wedding Collection - WearShare"); stage.setScene(scene); stage.show(); // Load wedding wardrobes loadWeddingWardrobes(); } private void loadWeddingWardrobes() { Task<List<WardrobeItem>> loadTask = new Task<List<WardrobeItem>>() { @Override protected List<WardrobeItem> call() throws Exception { return fetchWeddingWardrobesFromFirestore(); } @Override protected void succeeded() { Platform.runLater(() -> { loadingIndicator.setVisible(false); weddingWardrobes = getValue(); displayWeddingWardrobes(); }); } @Override protected void failed() { Platform.runLater(() -> { loadingIndicator.setVisible(false); showError("Failed to load wedding wardrobes: " + getException().getMessage()); }); } }; loadingIndicator.setVisible(true); new Thread(loadTask).start(); } private List<WardrobeItem> fetchWeddingWardrobesFromFirestore() throws IOException { // Using your existing Firestore collection "wardrobes" String firestoreUrl = "https://firestore.googleapis.com/v1/projects/wearshare-1e1ee/databases/(default)/documents/wardrobes"; HttpURLConnection conn = (HttpURLConnection) new URL(firestoreUrl).openConnection(); conn.setRequestMethod("GET"); conn.setRequestProperty("Content-Type", "application/json"); int responseCode = conn.getResponseCode(); if (responseCode != 200) { throw new IOException("Failed to fetch wardrobes: HTTP " + responseCode); } StringBuilder response = new StringBuilder(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()))) { String line; while ((line = reader.readLine()) != null) { response.append(line); } } return parseWeddingWardrobesFromJson(response.toString()); } private List<WardrobeItem> parseWeddingWardrobesFromJson(String json) { List<WardrobeItem> weddingItems = new ArrayList<>(); try { Pattern documentPattern = Pattern.compile("\"documents\":\\s*\\[(.*?)\\]", Pattern.DOTALL); Matcher documentMatcher = documentPattern.matcher(json); if (documentMatcher.find()) { String documentsContent = documentMatcher.group(1); String[] documents = documentsContent.split("\\},\\s*\\{"); for (String doc : documents) { WardrobeItem item = new WardrobeItem(); item.title = extractStringValue(doc, "title"); item.description = extractStringValue(doc, "description"); item.type = extractStringValue(doc, "type"); item.size = extractStringValue(doc, "size"); item.price = extractStringValue(doc, "price"); item.contact = extractStringValue(doc, "contact"); item.imageUrl = extractStringValue(doc, "imageUrl"); // Only add wedding items if ("Wedding".equalsIgnoreCase(item.type)) { weddingItems.add(item); } } } } catch (Exception e) { System.err.println("Error parsing JSON: " + e.getMessage()); e.printStackTrace(); } return weddingItems; } private String extractStringValue(String json, String fieldName) { Pattern pattern = Pattern.compile("\"" + fieldName + "\":\\s*\\{\\s*\"stringValue\":\\s*\"([^\"]*?)\""); Matcher matcher = pattern.matcher(json); return matcher.find() ? matcher.group(1) : ""; } private void displayWeddingWardrobes() { wardrobeContainer.getChildren().clear(); if (weddingWardrobes.isEmpty()) { VBox emptyState = createEmptyState(); wardrobeContainer.getChildren().add(emptyState); return; } // Header with count Label countLabel = new Label("✨ Found " + weddingWardrobes.size() + " beautiful wedding outfits"); countLabel.setStyle("-fx-font-size: 18px; -fx-text-fill: white; -fx-font-weight: bold; -fx-background-color: rgba(0,0,0,0.5); -fx-background-radius: 10; -fx-padding: 10 20;"); wardrobeContainer.getChildren().add(countLabel); // Create grid layout for wedding items FlowPane gridPane = new FlowPane(); gridPane.setHgap(25); gridPane.setVgap(25); gridPane.setAlignment(Pos.CENTER); gridPane.setPrefWrapLength(1100); for (WardrobeItem item : weddingWardrobes) { VBox card = createWeddingCard(item); gridPane.getChildren().add(card); } wardrobeContainer.getChildren().add(gridPane); } private VBox createEmptyState() { VBox emptyBox = new VBox(15); emptyBox.setAlignment(Pos.CENTER); emptyBox.setPadding(new Insets(50)); emptyBox.setStyle("-fx-background-color: rgba(255,255,255,0.9); -fx-background-radius: 15;"); Label emptyIcon = new Label("💒"); emptyIcon.setStyle("-fx-font-size: 48px;"); Label emptyTitle = new Label("No Wedding Outfits Yet"); emptyTitle.setStyle("-fx-font-size: 24px; -fx-font-weight: bold; -fx-text-fill: #2c3e50;"); Label emptyMessage = new Label("Be the first to share your beautiful wedding outfits!"); emptyMessage.setStyle("-fx-font-size: 16px; -fx-text-fill: #6c757d;"); Button shareBtn = new Button("Share Wedding Outfit"); shareBtn.setStyle("-fx-background-color: #e83e8c; -fx-text-fill: white; -fx-background-radius: 8; -fx-padding: 12 24; -fx-font-size: 14px; -fx-font-weight: bold;"); shareBtn.setOnAction(e -> { try { Stage currentStage = (Stage) shareBtn.getScene().getWindow(); new ShareWardrobePage().start(currentStage); } catch (Exception ex) { ex.printStackTrace(); } }); emptyBox.getChildren().addAll(emptyIcon, emptyTitle, emptyMessage, shareBtn); return emptyBox; } private VBox createWeddingCard(WardrobeItem item) { VBox card = new VBox(15); card.getStyleClass().add("wardrobe-card"); card.setPrefWidth(320); card.setMaxWidth(320); // Wedding badge and title HBox titleBox = new HBox(10); titleBox.setAlignment(Pos.CENTER_LEFT); Label weddingBadge = new Label("💒 Wedding"); weddingBadge.getStyleClass().add("wedding-badge"); Label titleLabel = new Label(item.title); titleLabel.getStyleClass().add("wardrobe-title"); titleLabel.setWrapText(true); titleBox.getChildren().addAll(weddingBadge, titleLabel); // Image with wedding styling ImageView imageView = new ImageView(); imageView.setFitWidth(280); imageView.setFitHeight(200); imageView.setPreserveRatio(true); imageView.setStyle("-fx-background-color: #f8f9fa; -fx-background-radius: 10; -fx-effect: dropshadow(gaussian, rgba(232,62,140,0.3), 5, 0, 0, 2);"); if (!item.imageUrl.isEmpty()) { Task<Image> imageTask = new Task<Image>() { @Override protected Image call() throws Exception { return new Image(item.imageUrl, true); } @Override protected void succeeded() { Platform.runLater(() -> imageView.setImage(getValue())); } @Override protected void failed() { Platform.runLater(() -> { // Set a default wedding image Image defaultImg = new Image("https://via.placeholder.com/280x200/e83e8c/ffffff?text=Wedding+Outfit"); imageView.setImage(defaultImg); }); } }; new Thread(imageTask).start(); } else { // Default wedding placeholder Image defaultImg = new Image("https://via.placeholder.com/280x200/e83e8c/ffffff?text=Wedding+Outfit"); imageView.setImage(defaultImg); } // Details with wedding theme HBox detailsBox = new HBox(20); detailsBox.setAlignment(Pos.CENTER_LEFT); VBox leftDetails = new VBox(5); Label sizeLabel = new Label("👗 Size: " + item.size); sizeLabel.getStyleClass().add("wardrobe-detail"); Label contactLabel = new Label("📞 " + item.contact); contactLabel.getStyleClass().add("wardrobe-detail"); leftDetails.getChildren().addAll(sizeLabel, contactLabel); VBox rightDetails = new VBox(5); rightDetails.setAlignment(Pos.CENTER_RIGHT); Label priceLabel = new Label("₹" + item.price + "/day"); priceLabel.getStyleClass().add("price-label"); rightDetails.getChildren().add(priceLabel); detailsBox.getChildren().addAll(leftDetails, rightDetails); // Description TextArea descArea = new TextArea(item.description); descArea.setEditable(false); descArea.setPrefRowCount(2); descArea.setWrapText(true); descArea.getStyleClass().add("wardrobe-detail"); descArea.setMaxHeight(60); descArea.setStyle("-fx-background-color: #f8f9fa; -fx-background-radius: 5;"); // Rent button with wedding theme Button rentBtn = new Button("💕 Rent for Wedding"); rentBtn.getStyleClass().add("rent-button"); rentBtn.setMaxWidth(Double.MAX_VALUE); rentBtn.setOnAction(e -> { CartPage cartPage = new CartPage(); Stage stage = (Stage) ((Button) e.getSource()).getScene().getWindow(); cartPage.initialize(stage); }); card.getChildren().addAll(titleBox, imageView, detailsBox, descArea, rentBtn); return card; } private void showError(String message) { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("Error"); alert.setHeaderText("Failed to Load Wedding Collection"); alert.setContentText(message); alert.showAndWait(); } // Data class for wardrobe items private static class WardrobeItem { String title = ""; String description = ""; String type = ""; String size = ""; String price = ""; String contact = ""; String imageUrl = ""; }} in wedding page match backgroud as landing page in weeding page the backgroud is to simple dont change any thing else than background