signup
This commit is contained in:
parent
f09d63dd21
commit
3f3875fd78
@ -13,53 +13,15 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class SingUpController {
|
||||
@FXML
|
||||
private TextField tfEmail;
|
||||
@FXML
|
||||
private TextField tfBestätigungEmail;
|
||||
@FXML
|
||||
private PasswordField pfPasswort;
|
||||
@FXML
|
||||
private PasswordField pfBestätigungPassowrt;
|
||||
|
||||
private HashMap<String, String> benutzermap = new HashMap<>();
|
||||
@FXML
|
||||
private void onKontoErstellenBtClick(){
|
||||
String email = tfEmail.getText();
|
||||
String bestätigungEmail = tfBestätigungEmail.getText();
|
||||
String passwort = pfPasswort.getText();
|
||||
String bestätigungPasswort = pfBestätigungPassowrt.getText();
|
||||
if(!(email.isEmpty() || bestätigungEmail.isEmpty() || passwort.isEmpty() && bestätigungEmail.isEmpty() || bestätigungPasswort.isEmpty())){
|
||||
|
||||
Alert alert;
|
||||
if(bestätigungEmail.equals(email) && bestätigungPasswort.equals(passwort)){
|
||||
alert = new Alert(Alert.AlertType.CONFIRMATION,"okay");
|
||||
alert.showAndWait();
|
||||
benutzermap.put(email,passwort);
|
||||
System.out.println(benutzermap);
|
||||
}else {
|
||||
alert = new Alert(Alert.AlertType.ERROR,"Die Eingabe passt nicht.");
|
||||
alert.showAndWait();
|
||||
}
|
||||
tfEmail.setText("");
|
||||
tfBestätigungEmail.setText("");
|
||||
pfPasswort.setText("");
|
||||
pfBestätigungPassowrt.setText("");
|
||||
}
|
||||
else {
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR,"Eingabefield sind leer");
|
||||
alert.showAndWait();
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void onAnmeldenBtClick() throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("login-view.fxml"));
|
||||
Scene scene = new Scene(fxmlLoader.load(), 950,480);
|
||||
HelloApplication.primary.setScene(scene);
|
||||
}
|
||||
public HashMap<String, String> getBenutzermap() {
|
||||
return benutzermap;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user