-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbout.java
More file actions
80 lines (54 loc) · 1.72 KB
/
Copy pathAbout.java
File metadata and controls
80 lines (54 loc) · 1.72 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package wf.util;
import java.io.IOException;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import wf.Main;
import wf.view.AboutController;
public class About {
private AboutController aboutController = new AboutController();
private AnchorPane about_ap = new AnchorPane();
private FXMLLoader loader = new FXMLLoader();
private Stage about_st = new Stage();
private static final About INSTANCE = new About();
public About() {
try {
loader.setLocation(Main.class.getResource("view/About.fxml"));
about_ap = ((AnchorPane) loader.load());
// Show the scene containing the root layout.
final Scene about_sc = new Scene(about_ap);
about_sc.getStylesheets().clear();
about_sc.getStylesheets().add(Main.class.getResource("/wf/view/application.css").toExternalForm());
about_st.setScene(about_sc);
about_st.setResizable(false);
about_st.initModality(Modality.APPLICATION_MODAL);
about_st.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
event.consume();
}
});
setStage(about_st);
} catch (IOException e) {
e.printStackTrace();
}
}
private void setStage(Stage stage) {
this.about_st = stage;
}
public Stage getStage() {
return about_st;
}
public void showStage() {
aboutController = loader.<AboutController>getController();
aboutController.getClass();
about_st.showAndWait();
}
public static About getInstance() {
return INSTANCE;
}
}