What is the error you get?

I'm not sure but try: JTextField.getText().toString()