parent
88be7b00fb
commit
3505f380ec
@ -1,11 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import java.lang.*?>
|
|
||||||
<?import java.util.*?>
|
|
||||||
<?import javafx.scene.*?>
|
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
<BorderPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml">
|
<BorderPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml">
|
||||||
|
<center>
|
||||||
|
<ListView fx:id="promLV"/>
|
||||||
|
</center>
|
||||||
|
<bottom>
|
||||||
|
<HBox>
|
||||||
|
<Button text="add student" onAction="#clickAddStudent"/>
|
||||||
|
<Button text="remove student" onAction="#clickRemoveStudent"/>
|
||||||
|
<Button text="QUIT" onAction="#clickQuit"/>
|
||||||
|
</HBox>
|
||||||
|
</bottom>
|
||||||
|
<right>
|
||||||
|
<VBox>
|
||||||
|
<HBox>
|
||||||
|
<Label text="last name: "/>
|
||||||
|
<TextField fx:id="lastnameTF"/>
|
||||||
|
</HBox>
|
||||||
|
<HBox>
|
||||||
|
<Label text="first name: "/>
|
||||||
|
<TextField fx:id="firstnameTF"/>
|
||||||
|
</HBox>
|
||||||
|
</VBox>
|
||||||
|
</right>
|
||||||
</BorderPane>
|
</BorderPane>
|
||||||
|
@ -1,11 +1,42 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.ListView;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
import viewmodel.PromotionVM;
|
import viewmodel.PromotionVM;
|
||||||
|
import viewmodel.StudentVM;
|
||||||
|
|
||||||
public class MainWindow {
|
public class MainWindow {
|
||||||
|
@FXML
|
||||||
|
private ListView<StudentVM> promLV;
|
||||||
|
@FXML
|
||||||
|
private TextField lastnameTF;
|
||||||
|
@FXML
|
||||||
|
private TextField firstnameTF;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void clickAddStudent() {
|
||||||
|
VM.addStudent();
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void clickRemoveStudent() {
|
||||||
|
VM.removeStudent(promLV.getSelectionModel().getSelectedItem());
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void clickQuit() {
|
||||||
|
lastnameTF.getScene().getWindow().hide();
|
||||||
|
}
|
||||||
|
|
||||||
private final PromotionVM VM;
|
private final PromotionVM VM;
|
||||||
|
|
||||||
public MainWindow(PromotionVM VM) {
|
public MainWindow(PromotionVM VM) {
|
||||||
this.VM = VM;
|
this.VM = VM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void initialize() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue