-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathController.java
50 lines (40 loc) · 1.42 KB
/
Controller.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.example.loanproject;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import java.util.ResourceBundle;
import java.net.URL;
public class Controller implements Initializable
{
public Label welcomeText;
@FXML
private Button button_login;
@FXML
private Button button_signup;
@FXML
private TextField tf_username;
@FXML
private TextField tf_password;
@Override
public void initialize(URL location, ResourceBundle resourses)
{
button_login.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
DBUtils.logInUser(event, tf_username.getText(), tf_password.getText());
}
});
button_signup.setOnAction(new EventHandler<ActionEvent>()
{
@Override
public void handle(ActionEvent event)
{
DBUtils.changeScene(event,"sign-up.fxml","Sign Up",null);
}
});
}
}