Username und Passwort

This commit is contained in:
2022-12-22 02:02:19 +01:00
parent d1737b730f
commit 31b6b2cc39
3 changed files with 53 additions and 12 deletions

View File

@@ -11,8 +11,13 @@ public class HelloApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
stage.setTitle("Hello World! von Richard");
/**
* @autor: Reshad Meher
* Fenstergrößer
* Fenstertitle
*/
Scene scene = new Scene(fxmlLoader.load(), 480, 280);
stage.setTitle("Essen Bestellung im Kindergarten");
stage.setScene(scene);
stage.show();
}

View File

@@ -1,14 +1,34 @@
package com.bib.essensbestellungsverwaltung;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
public class HelloController {
@FXML
private Label welcomeText;
/**
* @autor: Reshad Meher
* Username, Passwort , login
*/
@FXML
protected void onHelloButtonClick() {
welcomeText.setText("Welcome to JavaFX Application!");
private TextField unsernameEingabe;
@FXML
private TextField passwortEingabe;
@FXML
private Label lblAusgabe;
@FXML
protected void onLoginButtonClick() {
String benutzerEingabe = unsernameEingabe.getText();
String kennwortEingabe = passwortEingabe.getText();
if(benutzerEingabe.contains("Reshad") && kennwortEingabe.contains("test123")){
lblAusgabe.setText("Herzlich Willkommen, " + benutzerEingabe + "!");
}else {
Alert alert = new Alert(Alert.AlertType.ERROR,
"Die Benutzername oder Passwort ist falsch");
alert.showAndWait();
}
unsernameEingabe.setText("");
passwortEingabe.setText("");
}
}