如何使用 javafx 键盘部署应用程序?

How do I deploy an app with javafx keyboard?

我已经使用 javafx 构建了一个应用程序。它是为与触摸屏一起使用而开发的。在我的虚拟机中,我指定了以下参数:

-Dcom.sun.javafx.isEmbedded=true -Dcom.sun.javafx.touch=true -Dcom.sun.javafx.virtualKeyboard=javafx

有了这个参数,当我 select 输入某种数据时,javafx 数字键盘弹出。

现在我想使用 maven 以相同的参数部署应用程序。我该怎么做?

我试过以下 pom 定义(由 ItachiUchia 建议)但没有成功:

<plugin>
                <groupId>com.zenjava</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>8.1.2</version>
                <configuration>
                    <mainClass>com.mycompany.app_name.Main</mainClass>
                    <jvmArgs>
                        <argument>-Dcom.sun.javafx.isEmbedded=true</argument>
                        <argument>-Dcom.sun.javafx.touch=true</argument>
                        <argument>-Dcom.sun.javafx.virtualKeyboard=javafx</argument>
                    </jvmArgs>
                </configuration>
            </plugin>

谢谢

您可以在 javafx-maven-plugin 的配置中使用 jvmArgs 传递 JVM args。一个简单的例子:

<configuration>
    <jvmArgs>
        <argument>-Dcom.sun.javafx.isEmbedded=true</argument>
        <argument>-Dcom.sun.javafx.touch=true</argument>
        <argument>-Dcom.sun.javafx.virtualKeyboard=javafx</argument>
    </jvmArgs>
</configuration>