Help needed in getting bean binding to work

Tushar Kale <[email protected]> Sat, 16 Aug 2008 21:07:52 -0700 (PDT)
Newsgroups gmane.comp.java.netbeans.user-interface
Message-ID <[email protected]>
Here is a simple application with a text field, a button and a bean:

javax.swing.JTextField  	txFirstName; 
javax.swing.JButton 	buttonSetValue;
MyBean			myBean;

//when button is clicked, value of beans attribute is set
private void buttonSetValueActionPerformed(java.awt.event.ActionEvent evt) {
         myBean.setFirstName("Bob");  
    }

Here is how MyBean.java looks:

class MyBean {
	String firstName;
	....
}

txFirstName is bound to myBean.firstName


When application starts, text field is blank as bean's firstName value is
null.

When button is clicked, the firstName property is set to Bob. 

Since firstName is bound to txFirstName, I expected the text box to show
'Bob" but nothing appears.

Isn't this how bean binding supposed to work? Or I am doing something wrong?

Thanks for the help
~ Tushar
-- 
View this message in context: http://www.nabble.com/Help-needed-in-getting-bean-binding-to-work-tp19017369p19017369.html
Sent from the Netbeans - UI mailing list archive at Nabble.com.