2
I created a form on Java
interfacing Swing
, in this has a field textfield
Text and a button Send, in the code of the button need to assign the value informado
in the textfield
to a variable of the type String
, what is the function for this ?
Post your code so we can take a look.
– user28595
String str = textField.getText();
If I understand correctly, I believe that this already solves.– user28595
@Diegofelipe What is the reason of
(String)
, is some data conversion ?– Tiago Oliveira de Freitas
I corrected, as per java documentation in this case do not need to cast, it already brings straight as string.
– user28595
@Diegofelipe I will test as soon as possible.
– Tiago Oliveira de Freitas