JavaFX virtual keyboard overlaps textfield component

Viewed 286

I have a question about using a virtual keyboard on touch supported pc with ubuntu.I have managed to show the virtual keyboard when textfield is focused on java :

-Dcom.sun.javafx.isEmbedded=true
-Dcom.sun.javafx.touch=true
-Dcom.sun.javafx.virtualKeyboard=javafx 
-Dcom.sun.javafx.vk.adjustwindow=true

But when the keyboard show's up, it overlaps text fields below the keyboard.

According to official documentation 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. The keyboard slides in from the bottom area pushing the parent stage up in order to keep the control that the keyboard is associated with visible on the screen."

It should automatically push the text-field upward and make it visible.

I tried implementing the solution from JavaFX virtual keyboard overlaps nodes, but it was not working as per requirement.

import javafx.application.Application;                                                 
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class Main extends Application {
    @Override
    public void start(Stage stage) {
        TextField textField = new TextField();
        textField.setPromptText("Enter comment");
        BorderPane borderPane = new BorderPane(new Button("Click"));
        borderPane.setBottom(textField);
        Scene scene = new Scene(borderPane,1850,1200);
        stage.setScene(scene);
        stage.show();
    }
}

JavaFX virtual keyboard application- keyboard hidden

JavaFX virtual keyboard application- keyboard open

I would be grateful for any suggestions or solutions.

Thanks in advance.

enter image description here

0 Answers
Related