2011-03-16 34 views
0

尝试将背景图片添加到一个文本框,但是当在用户类型,并进入水平滚动的形象似乎在导致它被复制到如下所示: enter image description here如何将自定义图像添加到黑莓的文本框?

基本上我想第一个文本框在用户输入大量值后看起来像第二个。我有一个扩展horizo​​ntalfieldManager类,并在我的绘画功能如下:

protected void paint(Graphics g) 
{ 
    g.clear(); 
    if (mLabelMode) 
    { 
     g.setColor(mLabelColor); 
    } 
    else 
    { 
     g.setColor(mColor); 
    } 

    int x = this.getHorizontalScroll(); 

    g.drawImage(x, 0, mBackground.getWidth(), mBackground.getHeight(), mBackground, 0, 0, 0); 

    super.paint(g); 
} 

任何帮助将不胜感激。

回答