When focus is gained into a TextField
, the touch screen keyboard doesn't appear.
I suppose it's because a JavaFx Application isn't Metro compliant?
I find a way to pop up the keyboard:
public class Controller {
public static void showVirtualKeyboard(
ObservableValue<? extends Boolean> observable,
Boolean oldState,
Boolean hasFocus )
{
if( hasFocus ) {
try {
Runtime.getRuntime().exec(
"cmd /c \"C:\\Program Files\\Common Files\\microsoft " +
"shared\\ink\\tabtip.exe\"" );
}
catch( final Throwable t ) {
LogHelper.severe( t );
}
}
}
}
In any view:
final class VisualAnalysis extends GridPane implements IView {
private final TextField tech = new TextField();
@Override
public void setController( Controller ctrl ) {
...
tech.focusedProperty().addListener( Controller::showVirtualKeyboard );
}
It's a workaround. Have you discover a better way?