-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextBox.java
More file actions
45 lines (34 loc) · 1.16 KB
/
TextBox.java
File metadata and controls
45 lines (34 loc) · 1.16 KB
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
36
37
38
39
40
41
42
43
44
45
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.layout.*;
import javafx.scene.control.*;
import javafx.geometry.*;
import java.sql.Date;
import java.sql.SQLException;
public class TextBox {
public static void display(String message, DatabaseLogic dl, Scene s) {
Stage window = new Stage();
window.initModality(Modality.APPLICATION_MODAL);
window.setTitle("");
Label error = new Label();
Label label = new Label();
label.setText("Your output: ");
GridPane.setConstraints(label, 0, 0);
TextArea ta = TextAreaBuilder.create()
.prefWidth(800)
.prefHeight(600)
.wrapText(true)
.build();
ta.appendText(message);
Button goBack = new Button("Cancel");
goBack.setOnAction(event -> {
window.setScene(s);
});
VBox layout = new VBox(10);
layout.getChildren().addAll(label,ta, goBack);
layout.setAlignment(Pos.CENTER);
Scene scene = new Scene(layout);
window.setScene(scene);
window.showAndWait();
}
}