update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
179
.config/Code/User/History/-379ecc9a/2s9F.java
Normal file
179
.config/Code/User/History/-379ecc9a/2s9F.java
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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 label2 = new Label();
|
||||
label2.setPrefHeight(20);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
178
.config/Code/User/History/-379ecc9a/3dt0.java
Normal file
178
.config/Code/User/History/-379ecc9a/3dt0.java
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain, Label err){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
err.setText("Passwords do not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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 label2 = new Label();
|
||||
label2.setPrefHeight(20);
|
||||
label2.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, label2));
|
||||
|
||||
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, label2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
180
.config/Code/User/History/-379ecc9a/3j3R.java
Normal file
180
.config/Code/User/History/-379ecc9a/3j3R.java
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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 label2 = new Label("test");
|
||||
label2.setPrefHeight(20);
|
||||
label2.setStyle("-fx-color: red;");
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
168
.config/Code/User/History/-379ecc9a/3rXV.java
Normal file
168
.config/Code/User/History/-379ecc9a/3rXV.java
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
179
.config/Code/User/History/-379ecc9a/48NI.java
Normal file
179
.config/Code/User/History/-379ecc9a/48NI.java
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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 label2 = new Label();
|
||||
label2.setPrefHeight(20);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
180
.config/Code/User/History/-379ecc9a/54U6.java
Normal file
180
.config/Code/User/History/-379ecc9a/54U6.java
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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 label2 = new Label("test");
|
||||
label2.setPrefHeight(20);
|
||||
label2.setStyle("-fx-color: red;");
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, label2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
171
.config/Code/User/History/-379ecc9a/AP2L.java
Normal file
171
.config/Code/User/History/-379ecc9a/AP2L.java
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0: password.setStyle("-fx-border-color: red;"); System.out.println("login failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
176
.config/Code/User/History/-379ecc9a/AssL.java
Normal file
176
.config/Code/User/History/-379ecc9a/AssL.java
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/B8og.java
Normal file
169
.config/Code/User/History/-379ecc9a/B8og.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin());
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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());
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
173
.config/Code/User/History/-379ecc9a/CYOo.java
Normal file
173
.config/Code/User/History/-379ecc9a/CYOo.java
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
if(verified){
|
||||
stage.setScene(mainScene);
|
||||
}
|
||||
else{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
181
.config/Code/User/History/-379ecc9a/CuKO.java
Normal file
181
.config/Code/User/History/-379ecc9a/CuKO.java
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handlLogin(){
|
||||
|
||||
}
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
boolean a = HttpsUtil.verifyCredentials("test", "test");
|
||||
System.out.println(a);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> handleRegister = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(handleLogin);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/E6ZZ.java
Normal file
169
.config/Code/User/History/-379ecc9a/E6ZZ.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, TextField password){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin());
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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());
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
173
.config/Code/User/History/-379ecc9a/GHE4.java
Normal file
173
.config/Code/User/History/-379ecc9a/GHE4.java
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0: password.setStyle("-fx-border-color: red;"); System.out.println("login failed");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/IJ6D.java
Normal file
169
.config/Code/User/History/-379ecc9a/IJ6D.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin());
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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());
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
177
.config/Code/User/History/-379ecc9a/IiYv.java
Normal file
177
.config/Code/User/History/-379ecc9a/IiYv.java
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
boolean a = HttpsUtil.verifyCredentials("test", "test");
|
||||
System.out.println(a);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> handleRegister = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(handleLogin);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/JtNo.java
Normal file
169
.config/Code/User/History/-379ecc9a/JtNo.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(String username, String password){
|
||||
boolean verified = HttpsUtil.verifyCredentials(username, password);
|
||||
if(verified){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username.getText(), password.getText()));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
185
.config/Code/User/History/-379ecc9a/MzF3.java
Normal file
185
.config/Code/User/History/-379ecc9a/MzF3.java
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handlLogin(){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(){
|
||||
|
||||
}
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
boolean a = HttpsUtil.verifyCredentials("test", "test");
|
||||
System.out.println(a);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> handleRegister = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/OdGq.java
Normal file
169
.config/Code/User/History/-379ecc9a/OdGq.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin());
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
175
.config/Code/User/History/-379ecc9a/RG9s.java
Normal file
175
.config/Code/User/History/-379ecc9a/RG9s.java
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> handleRegister = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(handleLogin);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
176
.config/Code/User/History/-379ecc9a/U1fF.java
Normal file
176
.config/Code/User/History/-379ecc9a/U1fF.java
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> handleRegister = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(handleLogin);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
167
.config/Code/User/History/-379ecc9a/U64S.java
Normal file
167
.config/Code/User/History/-379ecc9a/U64S.java
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(String username, String password){
|
||||
boolean verified = HttpsUtil.verifyCredentials(username, password);
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username.getText(), password.getText()));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/V8Ep.java
Normal file
169
.config/Code/User/History/-379ecc9a/V8Ep.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handlLogin(){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin());
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
171
.config/Code/User/History/-379ecc9a/VX6D.java
Normal file
171
.config/Code/User/History/-379ecc9a/VX6D.java
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(String username, String password){
|
||||
HttpsUtil.verifyCredentials(username, password);
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username.getText(), password.getText()));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
180
.config/Code/User/History/-379ecc9a/WPLU.java
Normal file
180
.config/Code/User/History/-379ecc9a/WPLU.java
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain, Label err){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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 label2 = new Label();
|
||||
label2.setPrefHeight(20);
|
||||
label2.setStyle("-fx-text-fill: red;");
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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, label2));
|
||||
|
||||
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, label2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/Wqey.java
Normal file
169
.config/Code/User/History/-379ecc9a/Wqey.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, TextField password){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, TextField password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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());
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
176
.config/Code/User/History/-379ecc9a/Y41K.java
Normal file
176
.config/Code/User/History/-379ecc9a/Y41K.java
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
HttpsUtil.verifyCredentials("test", "test");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> handleRegister = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(handleLogin);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
178
.config/Code/User/History/-379ecc9a/Ypfx.java
Normal file
178
.config/Code/User/History/-379ecc9a/Ypfx.java
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain, Label err){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
err.setText("passwords do not match");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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 label2 = new Label();
|
||||
label2.setPrefHeight(20);
|
||||
label2.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, label2));
|
||||
|
||||
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, label2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
175
.config/Code/User/History/-379ecc9a/Yy25.java
Normal file
175
.config/Code/User/History/-379ecc9a/Yy25.java
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
EventHandler<ActionEvent> login = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> register = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(login);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
170
.config/Code/User/History/-379ecc9a/Zmob.java
Normal file
170
.config/Code/User/History/-379ecc9a/Zmob.java
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(String username, String password){
|
||||
boolean verified = HttpsUtil.verifyCredentials(username, password);
|
||||
if(verified){
|
||||
stage.setScene(mainScene);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username.getText(), password.getText()));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
176
.config/Code/User/History/-379ecc9a/bgRd.java
Normal file
176
.config/Code/User/History/-379ecc9a/bgRd.java
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
1
.config/Code/User/History/-379ecc9a/entries.json
Normal file
1
.config/Code/User/History/-379ecc9a/entries.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/Java/HCloud/hcloudclient/src/main/java/com/rutils/HClient.java","entries":[{"id":"Yy25.java","timestamp":1720175726921},{"id":"RG9s.java","timestamp":1720175750644},{"id":"U1fF.java","timestamp":1720175772808},{"id":"Y41K.java","timestamp":1720434690490},{"id":"IiYv.java","timestamp":1720434708986},{"id":"hJnO.java","timestamp":1720762601740},{"id":"CuKO.java","timestamp":1720762669734},{"id":"jTRm.java","timestamp":1720762686364},{"id":"l3IG.java","timestamp":1720762702557},{"id":"MzF3.java","timestamp":1720762722134},{"id":"V8Ep.java","timestamp":1720762745208},{"id":"OdGq.java","timestamp":1720762758784},{"id":"IJ6D.java","timestamp":1720762793011},{"id":"E6ZZ.java","timestamp":1720762954603},{"id":"Wqey.java","timestamp":1720762979483},{"id":"B8og.java","timestamp":1720762994087},{"id":"x1HP.java","timestamp":1720763033637},{"id":"hvWg.java","timestamp":1720763054534},{"id":"VX6D.java","timestamp":1720763146892},{"id":"vLCd.java","source":"Remove all unused imports","timestamp":1720763179475},{"id":"U64S.java","timestamp":1720763374735},{"id":"JtNo.java","timestamp":1720763388412},{"id":"vNkT.java","timestamp":1720763816228},{"id":"Zmob.java","timestamp":1720763905800},{"id":"z1xj.java","timestamp":1720763918937},{"id":"hRqK.java","timestamp":1720763934040},{"id":"qaa1.java","timestamp":1720763954250},{"id":"CYOo.java","timestamp":1720764049262},{"id":"pzZD.java","timestamp":1720775100376},{"id":"xLVy.java","timestamp":1720775201784},{"id":"3rXV.java","timestamp":1720775221985},{"id":"hWoF.java","timestamp":1720777942239},{"id":"mv6T.java","timestamp":1720778046523},{"id":"paHg.java","timestamp":1720778762653},{"id":"AP2L.java","timestamp":1720778779487},{"id":"GHE4.java","timestamp":1720778794020},{"id":"v0U2.java","timestamp":1720780279238},{"id":"bgRd.java","timestamp":1720780311042},{"id":"AssL.java","timestamp":1720780349648},{"id":"rCW6.java","timestamp":1720781509621},{"id":"pbHP.java","timestamp":1720781548538},{"id":"2s9F.java","timestamp":1720781571621},{"id":"48NI.java","timestamp":1720781602411},{"id":"3j3R.java","timestamp":1720781627924},{"id":"54U6.java","timestamp":1720781645388},{"id":"z5dV.java","timestamp":1720781697821},{"id":"WPLU.java","timestamp":1720781708418},{"id":"ppm2.java","timestamp":1720781724374},{"id":"3dt0.java","timestamp":1720781794001},{"id":"Ypfx.java","timestamp":1720781827284}]}
|
||||
179
.config/Code/User/History/-379ecc9a/hJnO.java
Normal file
179
.config/Code/User/History/-379ecc9a/hJnO.java
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
boolean a = HttpsUtil.verifyCredentials("test", "test");
|
||||
System.out.println(a);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> handleRegister = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(handleLogin);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
170
.config/Code/User/History/-379ecc9a/hRqK.java
Normal file
170
.config/Code/User/History/-379ecc9a/hRqK.java
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
boolean verified = HttpsUtil.verifyCredentials(username, password);
|
||||
if(verified){
|
||||
stage.setScene(mainScene);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/hWoF.java
Normal file
169
.config/Code/User/History/-379ecc9a/hWoF.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/hvWg.java
Normal file
169
.config/Code/User/History/-379ecc9a/hvWg.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username.getText(), password.getText()));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
185
.config/Code/User/History/-379ecc9a/jTRm.java
Normal file
185
.config/Code/User/History/-379ecc9a/jTRm.java
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handlLogin(){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(){
|
||||
|
||||
}
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
boolean a = HttpsUtil.verifyCredentials("test", "test");
|
||||
System.out.println(a);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> handleRegister = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(handleLogin);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
185
.config/Code/User/History/-379ecc9a/l3IG.java
Normal file
185
.config/Code/User/History/-379ecc9a/l3IG.java
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handlLogin(){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(){
|
||||
|
||||
}
|
||||
|
||||
EventHandler<ActionEvent> handleLogin = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
boolean a = HttpsUtil.verifyCredentials("test", "test");
|
||||
System.out.println(a);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
EventHandler<ActionEvent> handleRegister = new EventHandler<ActionEvent>(){
|
||||
@Override
|
||||
public void handle(ActionEvent event){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(handleLogin);
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(handleRegister);
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
171
.config/Code/User/History/-379ecc9a/mv6T.java
Normal file
171
.config/Code/User/History/-379ecc9a/mv6T.java
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0: password.setStyle("-fx-border-color: red;");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
171
.config/Code/User/History/-379ecc9a/paHg.java
Normal file
171
.config/Code/User/History/-379ecc9a/paHg.java
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0: password.setStyle("-fx-border-color: red;");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
176
.config/Code/User/History/-379ecc9a/pbHP.java
Normal file
176
.config/Code/User/History/-379ecc9a/pbHP.java
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
181
.config/Code/User/History/-379ecc9a/ppm2.java
Normal file
181
.config/Code/User/History/-379ecc9a/ppm2.java
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain, Label err){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
err.setText("Passwords do not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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 label2 = new Label();
|
||||
label2.setPrefHeight(20);
|
||||
label2.setStyle("-fx-text-fill: red;");
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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, label2));
|
||||
|
||||
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, label2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
168
.config/Code/User/History/-379ecc9a/pzZD.java
Normal file
168
.config/Code/User/History/-379ecc9a/pzZD.java
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
173
.config/Code/User/History/-379ecc9a/qaa1.java
Normal file
173
.config/Code/User/History/-379ecc9a/qaa1.java
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
boolean verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
if(verified){
|
||||
stage.setScene(mainScene);
|
||||
}
|
||||
else{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
179
.config/Code/User/History/-379ecc9a/rCW6.java
Normal file
179
.config/Code/User/History/-379ecc9a/rCW6.java
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Label label2 = new Label();
|
||||
label2.setPrefHeight(20);
|
||||
|
||||
// Region spcr2 = new Region();
|
||||
// spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, label2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
173
.config/Code/User/History/-379ecc9a/v0U2.java
Normal file
173
.config/Code/User/History/-379ecc9a/v0U2.java
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0: password.setStyle("-fx-border-color: red;"); System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
166
.config/Code/User/History/-379ecc9a/vLCd.java
Normal file
166
.config/Code/User/History/-379ecc9a/vLCd.java
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(String username, String password){
|
||||
HttpsUtil.verifyCredentials(username, password);
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username.getText(), password.getText()));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
170
.config/Code/User/History/-379ecc9a/vNkT.java
Normal file
170
.config/Code/User/History/-379ecc9a/vNkT.java
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(String username, String password){
|
||||
boolean verified = HttpsUtil.verifyCredentials(username, password);
|
||||
if(verified){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username.getText(), password.getText()));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
169
.config/Code/User/History/-379ecc9a/x1HP.java
Normal file
169
.config/Code/User/History/-379ecc9a/x1HP.java
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username.getText(), password.getText()));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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());
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
168
.config/Code/User/History/-379ecc9a/xLVy.java
Normal file
168
.config/Code/User/History/-379ecc9a/xLVy.java
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
170
.config/Code/User/History/-379ecc9a/z1xj.java
Normal file
170
.config/Code/User/History/-379ecc9a/z1xj.java
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
boolean verified = HttpsUtil.verifyCredentials(username, password);
|
||||
if(verified){
|
||||
stage.setScene(mainScene);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRegister(String username, String password){
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username.getText(), password.getText()));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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.getText(), password.getText()));
|
||||
|
||||
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, spcr2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
180
.config/Code/User/History/-379ecc9a/z5dV.java
Normal file
180
.config/Code/User/History/-379ecc9a/z5dV.java
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
package com.rutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class HClient extends Application{
|
||||
|
||||
static Stage stage;
|
||||
|
||||
static Scene loginScene;
|
||||
static Scene registerScene;
|
||||
static Scene mainScene;
|
||||
|
||||
public static void main(String[] args){
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage arg1){
|
||||
|
||||
stage = new Stage();
|
||||
stage.setMinWidth(800);
|
||||
stage.setMinHeight(750);
|
||||
|
||||
loginScene = createLoginScene();
|
||||
registerScene = createRegisterScene();
|
||||
|
||||
try{
|
||||
File style = new File("src/main/java/com/rutils/styles/darktheme.css");
|
||||
loginScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
registerScene.getStylesheets().add(style.toURI().toURL().toExternalForm());
|
||||
}
|
||||
catch(MalformedURLException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
stage.setScene(loginScene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public void handleLogin(TextField username, PasswordField password){
|
||||
// int verified = HttpsUtil.verifyCredentials(username.getText(), password.getText());
|
||||
|
||||
}
|
||||
|
||||
public void handleRegister(TextField username, PasswordField password, PasswordField passwordAgain){
|
||||
int status = HttpsUtil.registerUser(username.getText(), password.getText(), passwordAgain.getText());
|
||||
switch(status){
|
||||
case 0:
|
||||
password.setStyle("-fx-border-color: red;");
|
||||
passwordAgain.setStyle("-fx-border-color: red;");
|
||||
System.out.println("passwords not match");
|
||||
break;
|
||||
case 1: System.out.println("login success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scene createLoginScene(){
|
||||
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("Login");
|
||||
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);
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
Button login = new Button("Login");
|
||||
login.setFont(new Font(20));
|
||||
login.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
login.setPrefHeight(50);
|
||||
login.setOnAction(e -> handleLogin(username, password));
|
||||
|
||||
Label or = new Label("OR");
|
||||
or.setFont(new Font(30));
|
||||
|
||||
Button signup = new Button("Sign Up");
|
||||
signup.setFont(new Font(20));
|
||||
signup.maxWidthProperty().bind(scene.widthProperty().divide(3));
|
||||
signup.setPrefHeight(50);
|
||||
signup.setOnAction(e -> stage.setScene(registerScene));
|
||||
|
||||
root.getChildren().addAll(label, spcr1, username, password, spcr2, login, or, signup);
|
||||
return scene;
|
||||
}
|
||||
|
||||
private Scene 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 label2 = new Label();
|
||||
label2.setPrefHeight(20);
|
||||
label2.setStyle("-fx-text-fill: red;");
|
||||
|
||||
Region spcr2 = new Region();
|
||||
spcr1.setPrefHeight(20);
|
||||
|
||||
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, label2));
|
||||
|
||||
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, label2, signup, or, login);
|
||||
return scene;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue