Class Login

java.lang.Object
NTNU.IDATT1002.controllers.Login

public class Login
extends java.lang.Object
Controls the buttons and changeable elements on login.fxml, the page where you log into the application
Version:
1.0 22.03.2020
Author:
madslun
  • Field Summary

    Fields 
    Modifier and Type Field Description
    javafx.scene.text.Text error_msg  
    javafx.scene.control.Button login  
    javafx.scene.control.PasswordField Password  
    javafx.scene.control.Button signup  
    javafx.scene.control.TextField Username  
  • Constructor Summary

    Constructors 
    Constructor Description
    Login()  
  • Method Summary

    Modifier and Type Method Description
    void buttonLogin​(javafx.event.ActionEvent event)
    Method trying to login if login button is pressed
    void enterLogin​(javafx.scene.input.KeyEvent keyEvent)
    Method that registers a keyevent and tries to login if keyevent is entered
    void login()
    Method that tries to log in to the page with the entered credentials.
    void switchToSignup​(javafx.event.ActionEvent actionEvent)
    Method that changes scene to Sign Up page

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • Username

      public javafx.scene.control.TextField Username
    • Password

      public javafx.scene.control.PasswordField Password
    • signup

      public javafx.scene.control.Button signup
    • login

      public javafx.scene.control.Button login
    • error_msg

      public javafx.scene.text.Text error_msg
  • Constructor Details

  • Method Details

    • switchToSignup

      public void switchToSignup​(javafx.event.ActionEvent actionEvent) throws java.io.IOException
      Method that changes scene to Sign Up page
      Parameters:
      actionEvent -
      Throws:
      java.io.IOException
    • login

      public void login() throws java.io.IOException
      Method that tries to log in to the page with the entered credentials. If successful, scene changes to Main page. If not it displays an error.
      Throws:
      java.io.IOException
    • enterLogin

      public void enterLogin​(javafx.scene.input.KeyEvent keyEvent) throws java.io.IOException
      Method that registers a keyevent and tries to login if keyevent is entered
      Parameters:
      keyEvent -
      Throws:
      java.io.IOException
    • buttonLogin

      public void buttonLogin​(javafx.event.ActionEvent event) throws java.io.IOException
      Method trying to login if login button is pressed
      Parameters:
      event -
      Throws:
      java.io.IOException