-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
32 lines (27 loc) · 1.16 KB
/
Main.java
File metadata and controls
32 lines (27 loc) · 1.16 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
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
// laeme FXML-i paigutuse ja seadistame stseeni
Parent root = FXMLLoader.load(getClass().getResource("fx.fxml"));
primaryStage.setTitle("Numbri tuvastus");
primaryStage.setScene(new Scene(root, 588, 615)); // 588x615 suurune aken, et kõik elemendid mahuksid ekraanile
primaryStage.show();
} catch (Exception e) {
LogimiseSingleton.getInstants().getLogija().severe("FXML-i laadimine ebaõnnestus");
System.out.println("FXML-i laadimine ebaõnnestus");
}
}
public static void main(String[] args) {
// Kirjutame logi faili, et programmi töö algas
LogimiseSingleton.getInstants().getLogija().info("Rakenduse töö algas");
launch(args);
// Kirjutame logi faili, et programmi töö lõppes
LogimiseSingleton.getInstants().getLogija().info("Rakenduse töö lõppes");
}
}