1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package Launchers;
21
22 import Controllers.UsersGroupsAndYearsController;
23 import Exceptions.AccessException;
24 import Utilities.LogToFile;
25 import Utilities.Severity;
26 import javafx.fxml.FXMLLoader;
27 import javafx.scene.Scene;
28 import javafx.stage.Modality;
29 import javafx.stage.Stage;
30 import javafx.stage.Window;
31
32 import java.io.IOException;
33
34 public class UsersGroupsAndYears extends Window {
35 public UsersGroupsAndYears(Window owner) {
36 Stage stage = new Stage();
37 FXMLLoader loader;
38
39 Scene root;
40 try {
41 loader = new FXMLLoader(getClass().getResource("/UI/UsersGroupsAndYears.fxml"));
42 root = new Scene(loader.load());
43 UsersGroupsAndYearsController usersGroupsAndYearsController = loader.getController();
44 usersGroupsAndYearsController.initUsersGroupsAndYears(this);
45 stage.setScene(root);
46 stage.setTitle("Add User");
47 stage.initModality(Modality.APPLICATION_MODAL);
48 stage.initOwner(owner);
49
50 stage.showAndWait();
51 } catch (IOException e) {
52 LogToFile.log(e, Severity.SEVERE, "Error loading window. Please retry then reinstall application. If error persists, contact the developers.");
53 } catch (AccessException e) {
54 LogToFile.log(e, Severity.WARNING, "You do not have permission to access this window.");
55
56 }
57 }
58
59 }