1

我需要在 Blackberry JDE 中添加带有图像的 ObjectListField

4

1 回答 1

0

http://developerlife.com/tutorials/?p=898

public void drawListRow(ListField list, Graphics g, int index, int y, int w) {

    String text = (String) _data.elementAt(index);

    // draw the text /w ellipsis if it's too long...
    g.drawText(text,
               _defaultRowWidth + _textImagePadding, y,
               DrawStyle.LEADING | DrawStyle.ELLIPSIS,
               w - _defaultRowWidth - _textImagePadding);

    // draw the to the left of the text...
    g.drawBitmap(0, y, _bitmap.getWidth(), _bitmap.getHeight(), _bitmap, 0, 0);

  }
于 2010-04-26T20:43:46.567 回答