jtextfield question
hello all
i have a jtextfield that i use its text to retrieve information from a database, my problem is that i dont want this textfield to be empty when i press the button in order to retrieve info from the database
i tried the following
if(text.getDocument().getLength() == 0){
JOptionPane.showMessageDialog(null
,"Please enter some valid input"
,"ERROR"
, JOptionPane.ERROR_MESSAGE);
return;
}
but it does not work if u press the space button once...
is there is a more professional way to do it
please help
thanks in advance

