我是 javafx 新手。我制作了一个简单的应用程序表单。 它有
- 锚定 Pane
- Pane
- 文本字段
我在触摸屏设备上运行该应用程序,但虚拟键盘不显示。文本字段已经聚焦。
我使用的是 JDK 8u25、场景生成器 2.0。
根据我读到的内容,http://docs.oracle.com/javase/8/javafx/user-interface-tutorial/embed.htm
The virtual keyboard is shown automatically when a text input field is in focus. Note that the control that is associated with the keyboard remains visible when the keyboard is displayed. There is no need to push the parent stage up.
我该怎么办?提前致谢。
最佳答案
将以下参数添加到您的虚拟机选项中应该允许弹出虚拟键盘:
-Dcom.sun.javafx.isEmbedded=true -Dcom.sun.javafx.virtualKeyboard=javafx
之后,您可以指定键盘格式,如 JavaFX: Working with JavaFX UI Components 中所示。文档。
例如,在名为 textField 的 TextField 上,使用以下内容:
textField.getProperties().put("vkType", "numeric");
关于javafx-8 - JavaFX 虚拟键盘不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26777350/