-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEduController.java
42 lines (39 loc) · 1.48 KB
/
EduController.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
package com.example.loanproject;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
public class EduController implements Initializable {
@FXML
private Button button_home;
@Override
public void initialize(URL location, ResourceBundle resources) {
button_home.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent event) {
try {
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("logged-in.fxml"));
Scene scene = new Scene(fxmlLoader.load());
Stage stage = new Stage();
stage.setTitle("Home page");
stage.setScene(scene);
stage.show();
((Node) (event.getSource())).getScene().getWindow().hide();
} catch (IOException e) {
Logger logger = Logger.getLogger(getClass().getName());
logger.log(Level.SEVERE, "Failed", e);
}
}
});
}
}