Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Table updating problems
Table updating problems [message #465962] Tue, 27 December 2005 02:59
Saad Mahamood is currently offline Saad MahamoodFriend
Messages: 7
Registered: July 2009
Junior Member
Hello!

I have a 3x3 table, which contains images. When a user types in a query
in search box I have the table reload with new images. However, the
table doesn't show the new images, until I click on the table, and thus
invoking my untyped Listener, which listens for Table cell selections.
I've tried Table.redraw(), Table.update(), but with no luck - The code
for the inserting of images is below:

private void addTableData(ArrayList<Product> pList) throws IOException {
//Remove current data:
prodTable.removeAll();
ArrayList<Image> imageList = new ArrayList<Image>(3);
for(int i = 0; i < pList.size(); i++) {
//Get each Product:
Product prod = pList.get(i);
//Get Product Image:
Image prodImage = new Image(shell.getDisplay(),
new FileInputStream(prod.getImageURL()));
//Add product to imageList ArrayList:
imageList.add(prodImage);
//If imageList size is 3 or i == size of Product List
if(imageList.size() == 3 | i == pList.size() - 1) {
//Copy images to an Image Array:
Image[] images = new Image[imageList.size()];
for(int j=0; j < images.length; j++) {
images[j] = imageList.get(j);

}
//TableItem to table:
TableItem item = new TableItem(prodTable, SWT.NONE);
item.setImage(images);
imageList.removeAll(imageList);
}
}
}
Previous Topic:Creating Wizards with SWT
Next Topic:Any efficient way to save table item(I/O) ??
Goto Forum:
  


Current Time: Fri Apr 19 01:04:18 GMT 2024

Powered by FUDForum. Page generated in 0.02473 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top