Added some javadoc comments to GUI

This commit is contained in:
Sem van der Hoeven
2019-03-04 10:54:55 +01:00
3 changed files with 26 additions and 2 deletions

View File

@@ -5,13 +5,22 @@ import javafx.fxml.FXML;
import javafx.scene.control.Label; import javafx.scene.control.Label;
public class GUIController { public class GUIController {
int pressed; private int pressed;
//put @FXML to let the fxml file know that it can use this label, //put @FXML to let the fxml file know that it can use this label,
// ind of the same as with @Test in jUnit tests //kind of the same as with @Test in jUnit tests
/**
*the label to be edited by pressing the button
*/
@FXML @FXML
private Label txtLabel; private Label txtLabel;
/**
* increments the counter when the button is presssed
* @param event an event that happens (button is clicked)
* @throws Exception
*/
public void incrementLabel(ActionEvent event) throws Exception { public void incrementLabel(ActionEvent event) throws Exception {
// System.out.println("pressed button"); // System.out.println("pressed button");
pressed++; pressed++;

View File

@@ -8,10 +8,19 @@ import javafx.stage.Stage;
public class GUIMain extends Application { public class GUIMain extends Application {
/**
* launches the stage
* @param args
*/
public static void main(String[] args) { public static void main(String[] args) {
launch(args); launch(args);
} }
/**
*
* @param primaryStage the stage to be started
* @throws Exception when the fxml file can't be found
*/
@Override @Override
public void start(Stage primaryStage) throws Exception { public void start(Stage primaryStage) throws Exception {
//link fxml file //link fxml file

View File

@@ -28,6 +28,12 @@ public class LoginController {
@FXML @FXML
private Button loginbutton; private Button loginbutton;
/**
* redirects to the main stage when the login credentials are correct
* @param event the entered username and password, and clicking the button
* @throws Exception
* @author Sem van der Hoeven
*/
public void Login(ActionEvent event) throws Exception { public void Login(ActionEvent event) throws Exception {
//if the entered username and password are correct //if the entered username and password are correct
if (usertext.getText().equals("user") && passwordField.getText().equals("pass")) { if (usertext.getText().equals("user") && passwordField.getText().equals("pass")) {