-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
43 lines (33 loc) · 1.19 KB
/
Main.java
File metadata and controls
43 lines (33 loc) · 1.19 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
package sample;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class Main extends Application {
protected Controller controller;
protected MainInterface maininterface;
@Override
public void start(Stage primaryStage) throws Exception{
//load fxml
FXMLLoader loader = new FXMLLoader(getClass().getResource("sample.fxml"));
Parent root = (Parent) loader.load();
controller = loader.getController();
//set up stage
primaryStage.setTitle("Train Network");
primaryStage.setResizable(false);
primaryStage.setScene(new Scene(root, 1000, 580));
Image icon = new Image("sample/track.png");
primaryStage.getIcons().add(icon);
primaryStage.show();
//create interface
maininterface = new MainInterface(controller);
}
public static void main(String[] args) {
launch(args);
}
}