How to update the data in table?

I met a problem about how to update the data in table by thread.

First, I create a component:

VerticalSplitPanel vsplit = new VerticalSplitPanel();

[/color]Second, I create a table and add the table to vsplit by addComponent();The table’s code are below:
Table table = new Table();

	IndexedContainer c = new IndexedContainer();
	c.addContainerProperty(APPLIST_PROPERTY_ID, Integer.class, null);
	c.addContainerProperty(APPLIST_PROPERTY_APPNAME, String.class, null);
	//connect data source

	//set column headers


[/color]Third, I add datas to table:(here I add one Item in table, just for test)
Container c = table.getContainerDataSource(); Object itemId = c.addItem(); Item item = c.getItem(itemId); item.getItemProperty(APPLIST_PROPERTY_ID).setValue(a.getId()); item.getItemProperty(APPLIST_PROPERTY_APPNAME).setValue(a.getAppName());

[/color]Fourth, I need to update the data per 3 seconds, so , I made this class implements Runnable interface and implements the run()method.
public void run() {
try {
//update the data in table

                            //In here, suppose that I get a Object b from database, I need delete all data in table, and add the newly data in table
                            Container c = table.getContainerDataSource();
	                Object itemId = c.addItem();
	                Item item = c.getItem(itemId);

		} catch (InterruptedException e) {
			// TODO Auto-generated catch block


Unfortunately,I met two problems :
One: the table’s data still hold the old data and the newly data isn’t display, why?
Two: if you click the item in table, the data will update and display the newly data, why?
How could I solve those problems? Can you help me? Thanks!

Have a look at the following

especially this

I saw it. But I didn’t solve this problem. My problem is the second scenario.In that problem, Archie Cobbs saw the newly add item but the item with null perporty. But in my problem, the data which table hold are still old and never display the newly data or change. When I click the item in table, the data can be update and display the newly data. why? I use the thread to get the new data and update the table.

For reference to others reading this thread: the discussion has moved to
this thread

When accessing Vaadin components in a background thread, you need to synchronize to the Application instance and use a push or polling solution to have the UI updated before the next user action.
This thread
has more information.