|
class EditStage extends Stage {
private UIBspTableView05.Student std=null;
public boolean retcode=false;
private TextField tLastname = new TextField("") ;
private TextField tFirstname = new TextField("") ;
private TextField tMnr = new TextField("") ;
private ChoiceBox choiceNote = new ChoiceBox () ;
private double[] noten = {1.0,1.3, 1.7, 2.0,2.3, 2.7, 3.0,3.3, 3.7, 4.0,5.0 };
public EditStage (Stage parent, UIBspTableView05.Student std) {
this.std=std;
setGUI();
setResizable(true);
this.initOwner(parent);
initModality(Modality.WINDOW_MODAL); // javafx.stage.Modality
this.setTitle("UIBspGridPane05 edit student");
}
private void setGUI() {
GridPane gridpane = new GridPane();
gridpane.setVgap(25);
gridpane.setHgap(15);
gridpane.setGridLinesVisible(true);
gridpane.setPadding(new Insets(10) ); // TRBL
ColumnConstraints column1 = new ColumnConstraints();
//column1.setPercentWidth(0);
ColumnConstraints column2 = new ColumnConstraints();
column2.setPercentWidth(100);
gridpane.getColumnConstraints().addAll(column1, column2);
Label label = new Label("Bearbeiten eines Studenten") ;
label.setFont(new Font("Courier New",32));
label.setTextFill(Color.BLUE);
gridpane.add(label, 0, 0,2,1); // column=1 row=0
label = new Label("Nachname") ;
label.setFont(new Font("Courier New",22));
gridpane.add(label, 0, 1); // column=1 row=0
tLastname .setFont(new Font("Courier New",22));
gridpane.add(tLastname, 1, 1); // column=1 row=0
gridpane.setHgrow(tLastname, Priority.ALWAYS);
// -----------------------------------------------------
label = new Label("Vorname") ;
label.setFont(new Font("Courier New",22));
gridpane.add(label, 0, 2); // column=1 row=0
tFirstname.setFont(new Font("Courier New",22));
gridpane.add(tFirstname, 1, 2); // column=1 row=0
gridpane.setHgrow(tFirstname, Priority.ALWAYS);
// -----------------------------------------------------
label = new Label("MatrikelNr") ;
label.setFont(new Font("Courier New",22));
gridpane.add(label, 0, 3); // column=1 row=0
tMnr .setFont(new Font("Courier New",22));
gridpane.add(tMnr, 1, 3); // column=1 row=0
gridpane.setHgrow(tMnr, Priority.ALWAYS);
// -----------------------------------------------------
label = new Label("Note") ;
label.setFont(new Font("Courier New",22));
gridpane.add(label, 0, 4); // column=1 row=0
choiceNote.getItems().add(1.0);
choiceNote.getItems().add(1.3);
choiceNote.getItems().add(1.7);
choiceNote.getItems().add(2.0);
choiceNote.getItems().add(2.3);
choiceNote.getItems().add(2.7);
choiceNote.getItems().add(3.0);
choiceNote.getItems().add(3.3);
choiceNote.getItems().add(3.7);
choiceNote.getItems().add(4.0);
choiceNote.getItems().add(5.0);
choiceNote.setStyle("-fx-font: 22px \"Serif\";");
choiceNote.setPrefWidth(200);
//choiceNote .setFont(new Font("Courier New",22));
gridpane.add(choiceNote, 1, 4); // column=1 row=0
gridpane.setHgrow(choiceNote, Priority.ALWAYS);
// -----------------------------------------------------
FlowPane boxpane = new FlowPane(20,20);
boxpane.setBorder(new Border(new BorderStroke(Color.RED,
BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderWidths.DEFAULT)));
boxpane.setAlignment(Pos.CENTER);
boxpane.setMaxWidth(Double.POSITIVE_INFINITY);
gridpane.add(boxpane, 0, 5,2,1); // column=1 row=0
gridpane.setHalignment(boxpane, HPos.CENTER);
Button bnOk = new Button("Ok") ;
bnOk.setFont(new Font("Courier New",22));
bnOk.setMaxWidth(Double.POSITIVE_INFINITY);
bnOk.setOnAction(e->okClick());
boxpane.getChildren().add(bnOk);
boxpane.setMargin(bnOk, new Insets(0, 10, 0, 10) ); // TRBL
Button bnEsc = new Button("Esc") ;
bnEsc.setFont(new Font("Courier New",22));
bnEsc.setMaxWidth(Double.POSITIVE_INFINITY);
bnEsc.setOnAction(e->escClick());
boxpane.getChildren().add(bnEsc);
boxpane.setMargin(bnEsc, new Insets(0, 10, 0, 10) ); // TRBL
tLastname.setText(std.getLastname());
tFirstname.setText(std.getFirstname());
tMnr.setText(Integer.toString(std.getMnr()));
for (int i=0; i
|
|