-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.java
39 lines (29 loc) · 939 Bytes
/
Main.java
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
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.File;
public class Main extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Market market = null;
if(new File("market.market").exists()){
market = Market.fromFile();
}else{
market = new Market();
market.setTopStocks();
}
FXMLLoader loader = new FXMLLoader(getClass().getResource("Login.fxml"));
LoginController controller = new LoginController(market);
loader.setController(controller);
Parent root = loader.load();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}
}