JavaFX – show / hide virtual keyboard programmatically

Even if I don't use it, I need to keep the virtual keyboard on the screen

I tried to call on a text field Requestfocus(), but the keyboard will rise only when the item gets focus through the mouse or touch event (and disappear when it loses focus)

I want to change this default behavior

Solution

You should use this:

FXVK.init(textfield);
FXVK.attach(textfield);

The node you will pass in will be the input field you want to write using the keyboard (in this case, it is your textfield) If you want to turn off the keyboard, just use fxvk detach();

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>