added App app to app.

main
David Wu 9 years ago
parent 6bc81f566e
commit fa5992bfb2

@ -15,6 +15,7 @@ import java.io.IOException;
public class App extends Application { public class App extends Application {
private static Stage stage; private static Stage stage;
private static App app;
/** /**
* Entry point for running the programme * Entry point for running the programme
@ -31,6 +32,8 @@ public class App extends Application {
* @throws Exception if something wrong with title screen. * @throws Exception if something wrong with title screen.
*/ */
public void start(Stage stage) throws Exception { public void start(Stage stage) throws Exception {
App.stage = stage;
App.app = this;
stage.setOnCloseRequest(new EventHandler<WindowEvent>() { stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override @Override
public void handle(WindowEvent event) { public void handle(WindowEvent event) {
@ -38,7 +41,7 @@ public class App extends Application {
System.exit(0); System.exit(0);
} }
}); });
App.stage = stage;
loadStart(App.stage); loadStart(App.stage);
} }

Loading…
Cancel
Save