I need to compare if the name entered in the textField is the same as the "root" user. When comparing even by typing root Eclipse informs you that it is invalid. Unfortunately I do not understand the reason for the error.
// ...
model.Usuario mUser = new Usuario();
// Enviar Usuario e Senha
String tfUser = tfUsuario.getText().toString().trim();
char[] tfPassword = tfSenha.getPassword();
mUser.setUser(tfUser);
mUser.setPassword(tfPassword);
// ...
if(tfUsuario.getText() == "root") {
JOptionPane.showMessageDialog(null, "Válido", "Aviso", 0);
System.out.print(tfUsuario.getText());
} else if(tfUsuario.getText() != "root") {
JOptionPane.showMessageDialog(null, "Inválido", "Aviso", 0);
System.out.print("Nome do Usuário: " + tfUsuario.getText());
}