parent
ba93364bed
commit
8bcc0132af
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.TextField?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<AnchorPane xmlns="http://javafx.com/javafx"
|
||||||
|
xmlns:fx="http://javafx.com/fxml">
|
||||||
|
<VBox>
|
||||||
|
<HBox>
|
||||||
|
<Label text="LAST NAME"/>
|
||||||
|
<TextField fx:id="lastnameTF"/>
|
||||||
|
</HBox>
|
||||||
|
<HBox>
|
||||||
|
<Label text="first name"/>
|
||||||
|
<TextField fx:id="firstnameTF"/>
|
||||||
|
</HBox>
|
||||||
|
<HBox>
|
||||||
|
<Button text="OK" onAction="#clickCreate" disable="${lastnameTF.text.empty || firstnameTF.text.empty}"/>
|
||||||
|
<Button text="Cancel" onAction="#clickCancel"/>
|
||||||
|
</HBox>
|
||||||
|
</VBox>
|
||||||
|
|
||||||
|
</AnchorPane>
|
@ -0,0 +1,41 @@
|
|||||||
|
package view;
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
|
||||||
|
public class StudentCreationWindow {
|
||||||
|
|
||||||
|
private String lastname;
|
||||||
|
private String firstname;
|
||||||
|
|
||||||
|
public String getLastname() {
|
||||||
|
return lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstname() {
|
||||||
|
return firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField firstnameTF;
|
||||||
|
@FXML
|
||||||
|
private TextField lastnameTF;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void clickCreate() {
|
||||||
|
lastname = lastnameTF.getText();
|
||||||
|
firstname = firstnameTF.getText();
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void clickCancel() {
|
||||||
|
lastname = null;
|
||||||
|
firstname = null;
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void close(){
|
||||||
|
firstnameTF.getScene().getWindow().hide();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue