I am currently having difficulty in testing a condition if a certain button do not have a text on it.
For example i have a button in an array named btn[] and a textview(JLabel) named "tv", if i execute this code, nothing happened.
if(btn[1].getText().toString().isEmpty()){
tv.setText("Okay");
}
i also tried these following codes:
if(btn[1].getText().toString().equals(null)){
tv.setText("Okay");
}
if(btn[1].getText().toString().equals("")){
tv.setText("Okay");
}
if(btn[1].getText().toString().length()==0){
tv.setText("Okay");
}
is there something wrong with my code?
thanks for the replies