Hi,
I have some set of textfields and choiceboxes to multiple enter same data structure (name, surname and goalkeeper yes/no).
I want to go to next field by ENTER key - I use AddEventHandler (keypressed), but I must know witch field has focus to continue to the next field (when I get focus by mouse or TAB key and break order by enter key). To achieve this I use AddChangeListener (focusProperty). Each of them works good when works alone, but they dont want to work together.
Here is the example. If You comment AddFocusListener or AddKeyPressedListener the program works, but if both are active program crash.
Please help me, what am I doing wrong.
I have some set of textfields and choiceboxes to multiple enter same data structure (name, surname and goalkeeper yes/no).
I want to go to next field by ENTER key - I use AddEventHandler (keypressed), but I must know witch field has focus to continue to the next field (when I get focus by mouse or TAB key and break order by enter key). To achieve this I use AddChangeListener (focusProperty). Each of them works good when works alone, but they dont want to work together.
Here is the example. If You comment AddFocusListener or AddKeyPressedListener the program works, but if both are active program crash.
Please help me, what am I doing wrong.