The FocusEvent has a method getOppositeComponent()
that you might be able to use in your logic.
When the text field loses focus you invoke this method. If the component gaining focus is the table, then you don't make the table panel invisible. Then when the user clicks on the table focus should stay there.
To handle the Up/Down arrow keys from the text field you would need to use Key Bindings
. You would create an Action that gets the current selection from the table and then changes the selection by +/- 1 depending on the key that was pressed. Read the Swing tutorial on How to Use Key Bindings for more information.