Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6678981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:18:22+00:00 2026-05-26T04:18:22+00:00

I have setup a Netbeans form with a text-field bound to a bean property.

  • 0

I have setup a Netbeans form with a text-field bound to a bean property. The binding is supposed to be two-way, but only works one-way. Updates to the field in the GUI update the bean, but if the bean is updated, the GUI does not update.

The Netbeans generated code looks like this for each property:

binding=org.jdesktop.beansbinding.Bindings.createAutoBinding(
    org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, crmmast1,
    org.jdesktop.beansbinding.ELProperty.create("${fname}"), lname,
    org.jdesktop.beansbinding.BeanProperty.create("text"));

bindingGroup.addBinding(binding);

My bean has property change support added:

    private PropertyChangeSupport changeSupport = new
         PropertyChangeSupport(this);;

    public void addPropertyChangeListener (PropertyChangeListener listener) {
         changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(
         PropertyChangeListener listener) {       
         changeSupport.removePropertyChangeListener(listener);
    }

    public void firePropertyChange (String propertyName,
         Object old, Object newObj) {
         changeSupport.firePropertyChange(propertyName, old, newObj);
    }

Within the sett for the properties I have:

public void setFname(String newName) {
   firePropertyChange("fname", fname, newName);
   this.fname = newName;
}

When I update the underlying bean, the bean updates but the textfield does not (even though I have verified that a property change event is being fired.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:18:23+00:00Added an answer on May 26, 2026 at 4:18 am

    Ran into the same problem. Really annoying. It took me a long time to realize something about the AutoBinding: it appears to listen to actions within the Property context established between the Source and the Target that you specify in the createAutoBinding call. This is why entering text in the JTextField updates to your bean property with no problem. It’s on the same binding ‘rail’ so to speak.

    What this means is that when you attempt to update your JavaBean via its setX() call directly from another source, like I was doing with a JFileChooser, the members of the autobinding don’t see it, even though the firePropertyChange method is called.

    doing this does not work:

    myBean1.setFileLocation(fileChooser.getSelectedFile().getAbsolutePath());
    

    So, instead of doing that call, what I instead did was make sure the Binding had a ‘name’ attached to it, which gets placed as the last parameter in the createAutoBinding() call. I did this in the Netbeans Matisse Property editor Bind popup Tool under the Advanced tab. In the example below, it is named “fileLocation”.

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
    org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
     myBean1, 
    org.jdesktop.beansbinding.ELProperty.create("${fileLocation}"), 
    jTextField12, 
    org.jdesktop.beansbinding.BeanProperty.create("text"), 
    "fileLocation");
    bindingGroup.addBinding(binding);
    

    The call that got me on the binding ‘rail’ so that the JTextField would update with my selected file looked like the following:

                Binding fileBind = bindingGroup.getBinding("fileLocation");
                Property fileProp = fileBind.getSourceProperty();
                fileProp.setValue(myBean1, fileChooser.getSelectedFile().getAbsolutePath());
    

    I had to pull this up with getBinding() and getSourceProperty() from the global binding group because Matisse locks out direct access to the original binding, and I am not supposed to edit it since the code is autogenerated. If you are hand editing your code, then you could always ensure that you have an available name to access the Property object directly.

    In any case, the key to get an ‘outside influencer’ to work on the bean and the JTextField is to perform your changes on the Binding Property itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have netbeans setup with xdebug so it can debug php. However, this only
I have a PHP project setup in Netbeans (v6.8) where all the PHP files
I'm using NetBeans 6.5 for developing PHP and I have xdebug setup. Is there
I have netbeans 6.8 with java ME platform setup on my ubuntu 9.10. My
I have setup a property and implement INotifyPropertyChanged like so... public event PropertyChangedEventHandler PropertyChanged;
I have setup multiple SQL Service Broker Queues in a database but have not
I have setup coredata in my appDelegate, but it first loads the mainWindow.xib and
I have setup file of winform. but i want to change my icon how
I currently have a NetBeans php project setup to sync from my user directory
I have setup a Netbeans project having as development host a remote machine. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.