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

  • Home
  • SEARCH
  • 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 6641779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:51:03+00:00 2026-05-25T23:51:03+00:00

I insert data from a util.List into a JTable with beansbinding.I have wrapped an

  • 0

I insert data from a util.List into a JTable with beansbinding.I have wrapped an ArrayList into a ObservableList and Observable list assinged to uitl.List.I bound data in Netbeans and set up properties in ‘Table Content’ in Netbeans ‘JTable Beanbinding options’. First time when the list is updated, the JTable is also updated and it is ok. But second time when I set another util.List which is cast into Observable list to the list which is bound to the JTable, the list is updated, but JTable is not updated.(but when I set a list,the System.out.pr.. prints correct values of the list,here I changed the util.List to ObservableList and vise versa to find where the problem is,but no result as I expected)(but when I add objects to the list bound to JTable, then JTable was updated.)
How can I update the JTable when the list is updated(That means when I set a new list,the table is also updated every time I set a new list).

Here is my code used to set List

 public List<Customer> getSuggestionList() {
    return suggestionList;
 }

public void setSuggestionList(ObservableList suggestionList) {

    try {
        List oldSuggestionList = this.suggestionList;
        this.suggestionList = suggestionList;
        propertySupport.firePropertyChange(PROP_SUGGESTIONLIST, oldSuggestionList, suggestionList);

        System.out.println("Suggestionlist is setted-----------");
        Customer c = (Customer) suggestionList.get(0);
        System.out.println("sugesstion list customer--------" + c.getCustFname());
    } catch (Exception e) {
        e.printStackTrace();
    }
}
  • 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-25T23:51:04+00:00Added an answer on May 25, 2026 at 11:51 pm

    Just checked: it’s working as expected (manual coding of course, wouldn’t touch Netbeans ), sourceBean the class which has the property suggestionList;

        BindingGroup context = new BindingGroup();
        BeanProperty valuesProperty = BeanProperty.create("suggestionList");
    
        JTableBinding tableBinding = SwingBindings.createJTableBinding(
                UpdateStrategy.READ_WRITE,
                sourceBean, valuesProperty,
                table);
        context.addBinding(tableBinding);
        tableBinding.addColumnBinding(BeanProperty.create("firstName"));
        tableBinding.addColumnBinding(BeanProperty.create("lastName"));
        context.bind();
    
        // add a button which changes the suggestionList 
        Action next = new AbstractAction("new data") {
    
            public void actionPerformed(ActionEvent e) {
                sourceBean.setSuggestionList(createRandomData());
            }
    
        };
        button.setAction(next);
    

    summary: something is wrong with the code you are not showing 😉

    BTW: the getters/setters signatures should have the same type, which yours dont. Doesn’t make a difference in my test, in your context might or might not indicate some unwanted mixup

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

Sidebar

Related Questions

I have to read data from some files and insert the data into different
I need to insert data from table1 into table2. However, I would like to
now i need to insert some data from the sqlserver into a word,i know
I have an INSERT query that is pulling data from two tables and inserting
I'm using a JMS queue to read from and insert data into a postgres
I am trying to insert data from one of my existing table into another
I am trying to insert data from a csv file into mysql using BigDump.
I would like to insert data from a file into the table Division of
I insert data from a typed dataset into my MSSQL database by using SqlBuldCopy
I am using an SQL query to insert data from an excel worksheet into

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.