01-07-2011 07:37 AM
hello,
I am not getting any results from this code please check the code.
public class CMyFamilyFeature3 extends iFarmersScreen {
int DISPLAY_WIDTH = Display.getWidth();
int DISPLAY_HEIGHT = Display.getHeight();
Vector vector1 = new Vector();
Vector vector2 = new Vector();
public CMyFamilyFeature3(){
super(NO_VERTICAL_SCROLL|USE_ALL_HEIGHT);
vector1.addElement("Life in A NutShell 04:08");
vector1.addElement("Life - Tara Newby Story");
vector1.addElement("Life - Mark Smith Story");
vector2.addElement("This short video answers the basic questions with regard to the needs,specifications and the type of life insurance needed for a consumer.");
vector2.addElement("Tara Newby describes her tragic experience with regard to the needs,specifications and the type of life insurance needed for a consumer.");
vector2.addElement("In this short video Mark Smith Illustrated with regard to the needs,specifications and the type of life insurance needed for a consumer.");
ListField listfield = new ListField();
listfield.setBackground(BackgroundFactory.createSo
listfield.setRowHeight(80);
myListFieldCallBack callback = new myListFieldCallBack();
listfield.setCallback(callback);
// listfield.setChangeListener(buttonSet);
listfield.setSize(vector1.size());
add(listfield);
}
}
ListFieldCallback class
public class myListFieldCallBack implements ListFieldCallback{
int DISPLAY_WIDTH = Display.getWidth();
int DISPLAY_HEIGHT = Display.getHeight();
private static final int LEFTMOST = 0;
Vector vector1 = new Vector();
Vector vector2 = new Vector();
public void drawListRow(ListField listField, Graphics graphics, int index,
int y, int width) {
int xpos = LEFTMOST;
int ypos = y+30;
String text = (String)vector1 .elementAt(index);
String text1 = (String)vector2.elementAt(index);
Font ourBoldFont = ourFont.derive(Font.BOLD);
graphics.drawText((char) text.indexOf(index), 110, y, 0, width);
graphics.drawText(text1, xpos+15+90, ypos);
graphics.drawRect(0, ypos-30, width, 0);
}
public Object get(ListField listField, int index) {
//return vector1.elementAt(index);
return listField;
}
public int getPreferredWidth(ListField listField) {
return DISPLAY_WIDTH;
}
public int indexOfList(ListField listField, String prefix, int start) {
return -1;
}
}
is this code is right or any thinking missing.
please check this code and give me solution for this..
thanks
01-07-2011 07:45 AM
01-07-2011 07:53 AM
Are you using two ids and repeating your problems? That's is not playing fair for a number of reasons. Please just use one id and ask questions once.
http://supportforums.blackberry.com/t5/Java-Develo