How to get value from Form - Java - Swing

2

I created a form in Java with interface Swing , in this it has a field textfield Text and a button Send , in the code of the precise button to assign the value informado no textfield to a variable of type String , what is the function for this?

    
asked by anonymous 30.10.2015 / 13:49

1 answer

3

Edit: I had not seen the comments, it was bad.

The following code should work:

String s = textField.getText()

And from there you treat s as needed.

If you have more questions about TextField , follow the documentation: link

Embrace

    
30.10.2015 / 14:03