I'm using custom item and it's not displayed correctly in the emulator and in the device (6600). On older emulator everything works fine and on the device and newer emulator the custom item is displayed properly if i exit some other form that display the form with custom item. Any other paint will make the custom item disappear. Am I missing something ? All built-in items are displayed correctly.

I have a thread that clears the form once a minute by deleting all items and adding new items including my custom item.

Below the custom item code:

package buswatch;

import javax.microedition.lcdui.*;


public class BusInfoComponent extends CustomItem implements ItemCommandListener {

private String content;
private int[] bgColor;
private String lineID;
private int screenWidth;

public BusInfoComponent(String lineID, String info, int screenWidth) {
super(null);
this.lineID = lineID;
this.content = info;
this.setItemCommandListener(this);
this.bgColor = new int[3];
this.screenWidth = screenWidth;

}

public void sizeChanged(int i, int j) {
}

public void setContent(String content) {
this.content = content;
}

public String getContent() {
return this.getContent();
}

/**
* getMinContentWidth
*
* @return int
*/
protected int getMinContentWidth() {
return this.screenWidth;
}

/**
* getMinContentHeight
*
* @return int
*/
protected int getMinContentHeight() {
return 30;
}

/**
* getPrefContentWidth
*
* @param int0 int
* @return int
*/
protected int getPrefContentWidth(int int0) {
return this.screenWidth;
}

/**
* getPrefContentHeight
*
* @param int0 int
* @return int
*/
protected int getPrefContentHeight(int int0) {
return 30;
}

//public boolean traverse(int dir, int viewportWidth, int viewportHeight, int[] visRect_inout) {
// return true;
//}

/**
*
* @param graphics Graphics
* @param int1 int
* @param int2 int
*/
protected void paint(Graphics graphics, int int1, int int2) {
graphics.setColor(this.bgColor[0],this.bgColor[1], this.bgColor[2]);
graphics.fillRect(0,0,this.screenWidth-1,this.getMinimumHeight());
graphics.setColor(0,0,0);
Font f = Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_BOLD, Font.SIZE_MEDIUM);
graphics.setFont(f);
graphics.drawString(this.lineID,5,3,Graphics.TOP | Graphics.LEFT);
f = Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_PLAIN, Font.SIZE_MEDIUM);
graphics.setFont(f);
graphics.drawString(this.content,40,15,Graphics.TOP | Graphics.LEFT);
}

public void setBackgroundColor(int red, int green, int blue) {
this.bgColor[0] = red;
this.bgColor[1] = green;
this.bgColor[2] = blue;
}

/**
* commandAction
*
* @param command Command
* @param item Item
*/
public void commandAction(Command command, Item item) {
}

}