I have a FlexTable with many rows
ID - Word - Down - Up 1 - car - Down - 2 - cat - Down - Up ...more rows
FlexTable tb=new FlexTable();
tb.setText(0,0,"ID");
tb.setText(0,1,"Word");
tb.setText(0,2,"Down");
tb.setText(0,3,"Up");
tb.setText(1,0,"1");
tb.setText(1,1,"car");
tb.setText(2,0,"2");
tb.setText(2,1,"cat");
tb.setWidget(1,2,downButton);
tb.setWidget(2,3,upButton);
......
Now I have a button MoveUp & a button MoveDown. I want when user clicks Up (at row ID=2), the FlexTable will become
ID - Word - Down - Up 2 - cat - Down - Up 1 - car - Down ... more rows ...
& then when user click Down (at row ID=2), the FlexTable will become
ID - Word - Down - Up 1 - car - Down - 2 - cat - Down - Up ...more rows
For this type of implementations its better if you can use a Grid instead of FlexTable. But since you want to do it using flex table
This is how i would do it (This is going to be a very loooong answer :-) ). First you need to create a object which holds the row values. Then it would be easy to handle the operation. So first create a object with all the attributes that you need to put for a row.
Then you can create the data list which you want to add in to the table
Then write a method to draw the content in the flex table..
For this example im rendering this FlexTable into a FlowPanel.
This method do the position change of the row elements.