-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhomeController.java
95 lines (80 loc) · 2.56 KB
/
homeController.java
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
/**
*
* @author seanc
*/
package sample;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.event.ActionEvent;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
public class homeController implements Initializable {
@FXML
private Button nursedoc;
@FXML
private Button patient;
@FXML
private Button staff;
@FXML
private void handleNurseDoc(ActionEvent event) {
try
{
AnchorPane page = (AnchorPane) FXMLLoader.load(getClass().getResource("Doc_nurse.fxml"));
Stage stage = (Stage) (nursedoc.getScene().getWindow());
stage.getScene().setRoot(page);
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
@FXML
private void handlePatient(ActionEvent event)
{
try
{
AnchorPane page = (AnchorPane) FXMLLoader.load(getClass().getResource("Login.fxml"));
Stage stage = (Stage) (patient.getScene().getWindow());
stage.getScene().setRoot(page);
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
@FXML
private void handleStaff(ActionEvent event)
{
try
{
AnchorPane page = (AnchorPane) FXMLLoader.load(getClass().getResource("staff.fxml"));
Stage stage = (Stage) (nursedoc.getScene().getWindow());
stage.getScene().setRoot(page);
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) { }
private void configureButtons() {
if (nursedoc != null) {
nursedoc.setDisable(true);
}
if (patient != null) {
patient.setDisable(true);
}
if (staff != null) {
staff.setDisable(true);
}
}
}