This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Changes in JTextField should be observed by DocumentListener on it's document [code looks like: jTextField.getDocument().addDocumentListener(new DocumentListener() { ... }); ] I have to write this into code generator by hand (NB3.2.1, build 77), but I would like to form do it for me.
This is not possible. Form Editor can handle only events of the components (beans) themselves, not for their property values (even if they are beans too). See also issue 8089.
*** Issue 26399 has been marked as a duplicate of this issue. ***
jbuilder has solved this by allowing its form editor to expose the Document in a similar manner to other beans beloging to the form. you must do manually for every component: select a bean, like jtextfield, then locate its document property, then right click and choose "expose as class level variable", now in the treeview in the "other" section you find the document for the bean. click once on it and you see the events like insertUpdate) i don't understand why you cannot do a similar thing in netbeans. i'm starting to think that the gui builder is a low priority module, but please note that the gui builder is fundamental if we want java to spread on the desktop.
Okay, presented this way it can be taken as reasonable enhancement.
JBuilder is no longer realy around the living - but this feature is still not supported under netbeans. Blame swing, but this would be really a useful feature/hack for NetBeans7 ....
*** Bug 40690 has been marked as a duplicate of this bug. ***
*** Bug 75089 has been marked as a duplicate of this bug. ***
I came across this bug when trying to figure out how to add a document listener to a jTextField so that I can detect changes without an enter key press. I couldn't figure it out. So I guess it's not possible within NetBeans GUI builder. But I'll just go with focus lost instead rather than something like keypress events. Here's an example of real-time textfield checking using DocumentListener in the second example on this page - http://download.oracle.com/javase/tutorial/uiswing/components/textfield.html
I'd just like to clarify that even without GUI builder support it's pretty easy to add a document listener in the code. Just switch to the source and e.g. in the constructor just after the call of initComponents() you can write something like: jTextField1.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { } @Override public void removeUpdate(DocumentEvent e) { } @Override public void changedUpdate(DocumentEvent e) { } }); Where 'jTextField1' is the component added using the GUI builder. There's no need to enter some custom code in the GUI builder to be generated by it.
Thanks for that Tomas. So it's not in initComponents() where it probably should be but that could work.