问题
I'm new to javafx. I made a simple app form. It has
- Anchor Pane
- Pane
- Text field
I run that app on touch screen device, but the virtual keyboard doesn't show up. The textfield already focused.
I'm using JDK 8u25, scene builder 2.0.
According to what I read, 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.
What should I do? Thanks in advance.
回答1:
Adding the following arguments to your VM Options should allow the virtual keyboard to pop up:
-Dcom.sun.javafx.isEmbedded=true -Dcom.sun.javafx.virtualKeyboard=javafx
After that, you can specify the keyboard format as indicated in the JavaFX: Working with JavaFX UI Components document.
For example, on a TextField named textField, use the following:
textField.getProperties().put("vkType", "numeric");
来源:https://stackoverflow.com/questions/26777350/javafx-virtual-keyboard-doesnt-show