-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
62 lines (49 loc) · 1.94 KB
/
Main.java
File metadata and controls
62 lines (49 loc) · 1.94 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
package MESS;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Main extends Application {
Timer clock;
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("TheaterLogin.fxml"));
primaryStage.setTitle("MESS: Movie Theater Entertainment System");
primaryStage.setScene(new Scene(root, 1440, 900));
primaryStage.setFullScreen(true);
primaryStage.show();
// start time-out timer
MouseTimer timer = new MouseTimer();
timer.timer.start();
clock = new Timer(21000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (Session.getInstance().timeOut && Session.getInstance().currentScene == 3) {
Platform.runLater(new Runnable() {
@Override
public void run() {
try {
Parent employeeLogin = FXMLLoader.load(getClass().getResource("EmployeeLogin.fxml"));
Scene employeeLogin_scene = new Scene(employeeLogin);
primaryStage.setScene(employeeLogin_scene);
primaryStage.setFullScreen(true);
primaryStage.show();
Session.getInstance().currentScene = 2;
} catch (Exception e) {
}
}
});
}
}
});
clock.start();
}
}