I have one JTextField
called Name and one JTextArea
called Address. My requirement is when user has entered name in the JTextField
and pressed Enter key the cursor should go to the next text area which is Address.
Currently one can move from one textfield to other by pressing the tab key (which I believe is default). I would like to prohibit this and transfer the cursor only via the ENTER key.
I have tried transferfocus()
, but enter key does not take the cursor to the text area. How do I achieve this?