我從java.I調用JavaFX應用程序想要在該JavaFX應用程序中使用String參數。如何在ChatWithSpecificClient中獲取該參數?獲取Application.launch中的參數(Class,String ... args)
例如:
調用類
public class GenWindow{
public static void main(String[] args) {
Application.launch(ChatWithSpecificClient.class, "String arg");
}
}
調用的類
public class ChatWithSpecificClient extends Application {
private Parent createScene() {
BorderPane pane = new BorderPane();
return pane;
}
@Override
public void start(Stage primaryStage) {
Scene scene = new Scene(createScene());
primaryStage.setScene(scene);
primaryStage.show();
}
}
例如,如何設置這個窗口,這樣的說法的稱號?
謝謝你。你也幫了我。 – CodeRunner