Text Field: state checking
Hi all,
I am writing a To-Do List with java. Here's the sample:
http://geocities.com/bttyho/todolist.htm
I need to do a state checking routine to prevent the "Add" button from being activated if no data is present in the input box.
Can someone help? Here's the source java code:
http://geocities.com/bttyho/askingjava.txt
Thanks!
Betty
[386 byte] By [
Qyenyea] at [2007-11-26 21:50:57]

how to fix the following script?
private javax.swing.JTextField getJTextField() {
if(jTextField == null) {
jTextField = new javax.swing.JTextField();
jTextField.setSize(200, 30);
jTextField.setCaretPosition(0);
jTextField.setLocation(51, 56);
jTextField.getDocument().addDocumentListener(new DocumentListener() {
private void change(){
Object TextFieldContent = String.valueOf(getJTextField().getText());
if (TextFieldContent == null || TextFieldContent.equals(""))
System.out.println("haahaaa");
else
getJButton1().setEnabled(true);
System.out.println("hehe");
}
});
}
return jTextField;
}