i have created a table using the netbeans 5.5 table model and it works fine on emulator, however on an s60 nokia device, i cannot seem to scroll down the table. When the table first loads the table is displayed allright (picture)but when I try to scroll down, the table gets messed up(picture). However the data seems to be loaded into the tablemodel because if i move the cursor down and select a row, the right row is selected it just is not displayed properly on the screen.
Here is the code where the table displaying the data is created.
And here is the code where tablemodel is created.Code:public org.netbeans.microedition.lcdui.TableItem get_infoTable() { if (infoTable == null) { // Insert pre-init code here infoTable = new org.netbeans.microedition.lcdui.TableItem(getDisplay(), "Ahlstrom", get_infoModel()); // Insert post-init code here } return infoTable; }
Code:public org.netbeans.microedition.lcdui.SimpleTableModel get_infoModel() { if (infoModel == null) {//GEN-END:MVDGetBegin36 // Insert pre-init code here infoModel = new org.netbeans.microedition.lcdui.SimpleTableModel();//GEN-BEGIN:MVDGetInit36 infoModel.setColumnNames(null); // Insert post-init code here } return infoModel; }
And finally here is the code where actual data is loded in to the tablemodel. The shareparse getdata() and getextradata-methods returns a two dimensional string table containing the data.
Code:for(int i = 0; i < shareParser.getData().length; i++) { if(selected.compareTo(shareParser.getData()[i][0]) == 0) { selectedshare = i; returnForm = favForm; // Go to infoform only if favorite share was found from shareparser getDisplay().setCurrent(get_infoForm()); // Update info model infoTable.setLabel(shareParser.getData()[i][0]); infoModel.setValue(1, 0, shareParser.getData()[i][1]); infoModel.setValue(1, 1, shareParser.getData()[i][2]); infoModel.setValue(1, 2, shareParser.getExtraData()[i][1]); infoModel.setValue(1, 3, shareParser.getExtraData()[i][2]); infoModel.setValue(1, 4, shareParser.getExtraData()[i][3]); break; } }

Reply With Quote

