-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDescribedAlert.java
More file actions
27 lines (22 loc) · 814 Bytes
/
DescribedAlert.java
File metadata and controls
27 lines (22 loc) · 814 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
//Author: Dennis Eriksson Berg
import javafx.scene.control.Alert;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
public class DescribedAlert extends Alert {
private TextField nameField = new TextField();
private TextField descriptionField = new TextField();
public DescribedAlert() {
super(AlertType.CONFIRMATION);
GridPane describedGrid = new GridPane();
describedGrid.addRow(0, new Label("Namn: "), nameField);
describedGrid.addRow(1, new Label("Beskrivning: "), descriptionField);
getDialogPane().setContent(describedGrid);
}
public String getName() {
return nameField.getText();
}
public String getDescription() {
return descriptionField.getText();
}
}