-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyController.java
More file actions
35 lines (26 loc) · 853 Bytes
/
Copy pathMyController.java
File metadata and controls
35 lines (26 loc) · 853 Bytes
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
package part5javafx;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
public class MyController implements Initializable {
@FXML
private TextField username;
@FXML
private PasswordField password;
@Override
public void initialize(URL location, ResourceBundle resources) {
}
public void okAction(ActionEvent event) {
System.out.println("Username: " + this.username.getText() + ", Password: " + this.password.getText());
System.out.println("OK Button Fired!");
}
public void cancelAction(ActionEvent event) {
this.username.setText("");
this.password.setText("");
System.out.println("Cancel Button Fired!");
}
}