Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
912 views
in Technique[技术] by (71.8m points)

javafx - I build my own keyboard so I need to call it when double click on any text field?

I need when double click into any text field is coming as popup screen and when I wrote any character or number reflect into another text field

so all that I want it dear friends is how to call it to any class and when I write anything by keyboard reflect text field what I click it thanks

enter image description here

public class KeyboardController implements Initializable {

    @FXML
    private JFXButton p;

    @Override
    public void initialize(URL url, ResourceBundle rb) {
        write(textfield);
    }

    public void write(JFXTextField txf) {
        try {
            y.setOnAction(xe -> {
                textfield.setText(textfield.getText() + y.getText());
            });
            z.setOnAction(xe -> {
                textfield.setText(textfield.getText() + z.getText());
            });
        } catch (Exception es) {
            System.out.println(es);
        }
    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...