-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIndexController.java
More file actions
38 lines (32 loc) · 1.06 KB
/
IndexController.java
File metadata and controls
38 lines (32 loc) · 1.06 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
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.stage.Stage;
public class IndexController {
@FXML
private Button InstuctorButton;
@FXML
private Button StudentButton;
@FXML
private Label WelcomLabel;
@FXML
void openStudentPage(ActionEvent event) throws Exception{
Stage stage = (Stage) InstuctorButton.getScene().getWindow();
Parent root = FXMLLoader.load(getClass().getResource("StudentLogin.fxml"));
Scene scene = new Scene(root);
stage.setTitle("LMS");
stage.setScene(scene);
}
@FXML
void openInstructorPage(ActionEvent event) throws Exception{
Stage stage = (Stage) InstuctorButton.getScene().getWindow();
Parent root = FXMLLoader.load(getClass().getResource("InstructorLogin.fxml"));
Scene scene = new Scene(root);
stage.setTitle("Login");
stage.setScene(scene);
}
}