MarketSquare / remoteswinglibrary

RemoteSwingLibrary
Apache License 2.0
31 stars 39 forks source link

RemoteSwingLibrary - Insert Into Text Field does not fire KeyListener #90

Closed sjhughes77 closed 4 years ago

sjhughes77 commented 4 years ago

Java program: JTextField textField = new JTextField(); textField.setName("textfield); textField.addKeyListener(new KeyAdapter() {

    public void keyReleased(KeyEvent event) {
        System,out.println("handle key event");
    }
});

RF script:

Insert Into Text Field textfield 100.00

the KeyEvent is not actioned.

sjhughes77 commented 4 years ago

Please ignore this issue. Further research reveals that a DocumentFilter attached to the Document of the JTextField handles the Insert Text action. It would seem using a KeyListener is an older way of trapping events and has been superceded by DocumentFilter.