I have a main class which should call a JavaFX application (SimpleSun) to get Information from the user. Currently I create an Object of the JavaFX class and start it, but t
You must provide a constructor with no arguments when you extend application. So you could do something like:
public class SimpleSun extends Application {
private Stage primaryStage;
Configuration configuration;
public SimpleSun() {
this.configuration = Main.getConfig();
}
//...
and in your Main class:
public static Configuration getConfig() { return new ConfigurationFromFile(); }
Alternatively you can pass String parameters to the class with launch(args) and get them back in the SimpleSun class with getParameters().