I have a textfield called x.
When the textfield contains " ", I want to do something. If it does not, do something else.
I tried doing
String test = x.getText();
if(test.startsWith(" ")){buttonN.setForeground(Color.GRAY));}
else{buttonN.setForeground(Color.BLACK));}
but it didnt work. any suggestions