I am currently coding a gui and want to verify that the user fills in the textbox a String. I tried that:
String name = textBoxes.get(0).getText();
if(name.isEmpty()) {
showError("Pls insert a name!");
} else{
name = textBoxes.get(0).getText();
}
But that really does not work? It seems to be that there is sth. "inside" the textbox, even if I do not fill sth. in.(I tried sysout and got that:
' '
So my question is, how to verify if a textbox is empty or not?