I am learning java and I have seen a problem in creating a login, I want to store the data that a user enters in a JTextArea in a variable, but it is not stored, and when I give a button that compares it with a name that I have put (since I still do not handle with databases) I have tried it in several ways and I can not do it, I do not know if it's better with JTextArea you can not and you would have to use something else. Thanks in advance
I echo:
JTextArea areausuario = new JTextArea("", 1, 16);
String ususario=areausuario.getText();
//Comprobar que hay en la variable
System.out.println(usuario);