This commit is contained in:
RafayAhmad7548 2024-09-09 16:59:28 +05:00
parent 2992f4f408
commit 4f46de8d00
3330 changed files with 394553 additions and 76939 deletions

View file

@ -0,0 +1,63 @@
package com.rutils;
public class Scenes{
public static void createRegisterScene(){
VBox root = new VBox();
Scene scene = new Scene(root);
root.requestFocus();
root.setAlignment(Pos.CENTER);
root.setSpacing(25);
root.minWidthProperty().bind(stage.widthProperty());
root.minHeightProperty().bind(stage.heightProperty());
Label label = new Label("Sign Up");
label.setFont(new Font(40));
Region spcr1 = new Region();
spcr1.setPrefHeight(20);
TextField username = new TextField();
username.setPromptText("username");
username.setFont(new Font(20));
username.maxWidthProperty().bind(scene.widthProperty().divide(3));
username.setPrefHeight(50);
PasswordField password = new PasswordField();
password.setPromptText("password");
password.setFont(new Font(20));
password.maxWidthProperty().bind(scene.widthProperty().divide(3));
password.setPrefHeight(50);
PasswordField passwordAgain = new PasswordField();
passwordAgain.setPromptText("confirm password");
passwordAgain.setFont(new Font(20));
passwordAgain.maxWidthProperty().bind(scene.widthProperty().divide(3));
passwordAgain.setPrefHeight(50);
Label info = new Label();
info.setPrefHeight(20);
info.setStyle("-fx-text-fill: red;");
Button signup = new Button("Sign Up");
signup.setFont(new Font(20));
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
signup.setPrefHeight(50);
signup.setOnAction(e -> handleRegister(username, password, passwordAgain, info));
Label or = new Label("OR");
or.setFont(new Font(30));
Button login = new Button("Login Instead");
login.setFont(new Font(20));
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
login.setPrefHeight(50);
login.setOnAction(e -> stage.setScene(loginScene));
root.getChildren().addAll(label, spcr1, username, password, passwordAgain, info, signup, or, login);
return scene;
}
}