More fixes to stages. Now clicking away from the text field removes the JTextField