-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
45 lines (33 loc) · 1.33 KB
/
Main.java
File metadata and controls
45 lines (33 loc) · 1.33 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
package MMS.Project.BCodeGen;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.stage.Stage;
public class Main extends Application {
private static Controller guiCtrl;
@Override
public void start(Stage primaryStage) throws Exception{
try {
FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("MainWindow" +
".fxml"));
Parent root = fxmlLoader.load();
guiCtrl = fxmlLoader.getController();
primaryStage.setTitle("Barcode Generator");
primaryStage.setScene(new Scene(root, 1080, 720));
primaryStage.show();
guiCtrl.setup();
}
catch(Exception e){
Alert eAlert = new Alert(Alert.AlertType.ERROR);
eAlert.setTitle("Not able to load FXML");
eAlert.setHeaderText("An exception occured when attempting to load \"MainWindow.fxml\" resource");
eAlert.setContentText(e.toString());
eAlert.showAndWait();
}
}
public static void main(String[] args) {
launch(args);
}
}