Populating JTextField based on latest KeyStroke
The use case in my UI is to populate two JTextField components based on double clicking items in a JList . The easy was is to use a JCheckBox populate jTextField1 if the checkbox is selected, and populate the other if it is not selected or vice versa which is working perfectly. But I would like to explore if this can be done without the checkbox. As in, if I type something in jtextfield1 and double click the item in list to complete the text, the item clicked should be appended to jtextfield1 based on fetching the latest KeyStroke I used. Is there are any way to do this? The use case in my UI