Search code examples
codenameone

How to prevent the virtual keyboard from showing on JavaSE build


I tried looking for a way to prevent the virtual keyboard from showing the first time a text field is focused on a JavaSE build but wasn't successful.

What is the best way to achieve this?


Solution

  • Use the following code in your init(Object) method to disable that behavior:

    Display.getInstance().setProperty("javase.win.vkb", "false")
    

    This should disable that behavior and only impact windows touch devices.