first commit
[jalview-fx.git] / src / application / Main.java
1 package application;
2
3 import java.net.URL;
4
5 import javafx.application.Application;
6 import javafx.fxml.FXMLLoader;
7 import javafx.scene.Parent;
8 import javafx.scene.Scene;
9 import javafx.stage.Stage;
10
11 public class Main extends Application {
12
13         private static Stage primaryStage;
14         
15         public static void main(String[] args) {
16                 launch(args);
17         }
18
19         
20         @Override
21         public void start(Stage primaryStage) throws Exception {
22                 setPrimaryStage(primaryStage);
23                 System.out.println("javafx.runtime.version: " + System.getProperties().get("javafx.runtime.version"));
24                 Scene sceneOne = new Scene((Parent) FXMLLoader.load(getClass().getResource("/fxml/HelloWorld.fxml")));          
25                 primaryStage.setTitle("JavaFX POC");
26                 primaryStage.setScene(sceneOne);
27                 primaryStage.show();
28                 
29                 
30         }
31
32         public URL resource(String path){
33                 return getClass().getResource(path);
34         }
35
36
37         public static Stage getPrimaryStage() {
38                 return primaryStage;
39         }
40
41
42         public void setPrimaryStage(Stage primaryStage) {
43                 Main.primaryStage = primaryStage;
44         }
45
46 }