How to pass parameters to JavaFX application?

后端 未结 8 574
温柔的废话
温柔的废话 2020-11-28 13:49

I am running my JavaFX application like this:

public class MainEntry {
    public static void main(String[] args) {
        Controller controller = new Contr         


        
8条回答
  •  没有蜡笔的小新
    2020-11-28 14:12

    The String array passed to the main() method are the parameters of the application, not specifically to the JavaFX module if you arbitrarily choose to use JavaFX.

    The easiest solution could be to store the argumets for later use (e.g. static attribute next to the main() method, and a static getter method to access it).

提交回复
热议问题